From f732b80b92fcf8adb1e672365a53c649fa694ed3 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 21 Jul 2021 15:48:04 -0400 Subject: [PATCH] add swap usage percent to overview dash --- salt/grafana/defaults.yaml | 24 +++ .../swap_usage_percent_graph.json.jinja | 154 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 salt/grafana/panels/swap_usage_percent_graph.json.jinja diff --git a/salt/grafana/defaults.yaml b/salt/grafana/defaults.yaml index 3a0b11719..0983f75f2 100644 --- a/salt/grafana/defaults.yaml +++ b/salt/grafana/defaults.yaml @@ -110,7 +110,31 @@ grafana: h: 8 w: 24 + row_swap: + gridPos: + x: 0 + y: 58 + h: 1 + w: 24 + swap_usage_percent_graph: + gridPos: + x: 0 + y: 59 + h: 8 + w: 24 + row_network: + gridPos: + x: 0 + y: 67 + h: 1 + w: 24 + management_interface_traffic_graph: + gridPos: + x: 0 + y: 68 + h: 8 + w: 24 standalone: diff --git a/salt/grafana/panels/swap_usage_percent_graph.json.jinja b/salt/grafana/panels/swap_usage_percent_graph.json.jinja new file mode 100644 index 000000000..ebe5c1bd0 --- /dev/null +++ b/salt/grafana/panels/swap_usage_percent_graph.json.jinja @@ -0,0 +1,154 @@ +{ + "type": "graph", + "title": "Swap Usage", + "gridPos": { + "x": {{ PANELS.swap_usage_percent_graph.gridPos.x }}, + "y": {{ PANELS.swap_usage_percent_graph.gridPos.y }}, + "w": {{ PANELS.swap_usage_percent_graph.gridPos.w }}, + "h": {{ PANELS.swap_usage_percent_graph.gridPos.h }} + }, + "id": 69013, + "targets": [ + { + "refId": "A", + "queryType": "randomWalk", + "policy": "default", + "resultFormat": "time_series", + "orderByTime": "ASC", + "tags": [ + { + "key": "host", + "operator": "=~", + "value": "/^$servername$/" + }, + { + "condition": "AND", + "key": "role", + "operator": "=~", + "value": "/^$role$/" + } + ], + "groupBy": [ + { + "type": "time", + "params": [ + "$__interval" + ] + }, + { + "type": "tag", + "params": [ + "host" + ] + }, + { + "type": "tag", + "params": [ + "role" + ] + }, + { + "type": "fill", + "params": [ + "null" + ] + } + ], + "select": [ + [ + { + "type": "field", + "params": [ + "used_percent" + ] + }, + { + "type": "mean", + "params": [] + } + ] + ], + "measurement": "swap", + "alias": "$tag_host $tag_role" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:100", + "decimals": 1 + }, + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:101" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "linewidth": 1, + "dashLength": 10, + "spaceLength": 10, + "pointradius": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 2 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "fill": 0, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false +}