From a6630540a4f8e5738716c75b17f87afe762478ac Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 21 Jul 2021 18:11:42 -0400 Subject: [PATCH] add system uptime graph to overview dash --- salt/grafana/defaults.yaml | 40 +++-- .../panels/system_uptime_graph.json.jinja | 154 ++++++++++++++++++ 2 files changed, 177 insertions(+), 17 deletions(-) create mode 100644 salt/grafana/panels/system_uptime_graph.json.jinja diff --git a/salt/grafana/defaults.yaml b/salt/grafana/defaults.yaml index 462d51f44..29678137e 100644 --- a/salt/grafana/defaults.yaml +++ b/salt/grafana/defaults.yaml @@ -36,109 +36,115 @@ grafana: - cpucount - disk panels: - row_cpu: + system_uptime_graph: gridPos: x: 0 y: 0 + h: 8 + w: 24 + row_cpu: + gridPos: + x: 0 + y: 8 h: 1 w: 24 cpu_usage_current_graph: gridPos: x: 0 - y: 1 + y: 8 h: 8 w: 24 io_wait_graph: gridPos: x: 0 - y: 9 + y: 17 h: 8 w: 24 cpu_usage_tasks_running_graph: gridPos: x: 0 - y: 17 + y: 25 h: 8 w: 24 cpu_usage_tasks_zombies_graph: gridPos: x: 0 - y: 25 + y: 33 h: 8 w: 12 cpu_usage_tasks_stopped_graph: gridPos: x: 12 - y: 25 + y: 33 h: 8 w: 12 cpu_usage_tasks_sleeping_graph: gridPos: x: 0 - y: 33 + y: 41 h: 8 w: 12 cpu_usage_tasks_blocked_graph: gridPos: x: 12 - y: 33 + y: 41 h: 8 w: 12 cpu_usage_tasks_paging_graph: gridPos: x: 0 - y: 41 + y: 49 h: 8 w: 12 cpu_usage_tasks_unknown_graph: gridPos: x: 12 - y: 41 + y: 49 h: 8 w: 12 row_memory: gridPos: x: 0 - y: 49 + y: 57 h: 1 w: 24 memory_usage_percent_graph: gridPos: x: 0 - y: 50 + y: 58 h: 8 w: 24 row_swap: gridPos: x: 0 - y: 58 + y: 64 h: 1 w: 24 swap_usage_percent_graph: gridPos: x: 0 - y: 59 + y: 65 h: 8 w: 24 row_network: gridPos: x: 0 - y: 67 + y: 73 h: 1 w: 24 management_interface_traffic_inbound_graph: gridPos: x: 0 - y: 68 + y: 74 h: 8 w: 24 management_interface_traffic_outbound_graph: gridPos: x: 0 - y: 76 + y: 82 h: 8 w: 24 diff --git a/salt/grafana/panels/system_uptime_graph.json.jinja b/salt/grafana/panels/system_uptime_graph.json.jinja new file mode 100644 index 000000000..74073651c --- /dev/null +++ b/salt/grafana/panels/system_uptime_graph.json.jinja @@ -0,0 +1,154 @@ +{ + "type": "graph", + "title": "System Uptime", + "gridPos": { + "x": {{ PANELS.system_uptime_graph.gridPos.x }}, + "y": {{ PANELS.system_uptime_graph.gridPos.y }}, + "w": {{ PANELS.system_uptime_graph.gridPos.w }}, + "h": {{ PANELS.system_uptime_graph.gridPos.h }} + }, + "id": 69016, + "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": [ + "uptime" + ] + }, + { + "type": "last", + "params": [] + } + ] + ], + "measurement": "system", + "alias": "$tag_host $tag_role" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": "", + "show": true, + "logBase": 1, + "min": "0", + "max": "604800", + "format": "s", + "$$hashKey": "object:213", + "decimals": 1 + }, + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:214" + } + ], + "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": { + "show": true, + "values": true, + "min": false, + "max": false, + "current": true, + "total": false, + "avg": false, + "alignAsTable": true, + "rightSide": true + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 1 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "fill": 0, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false, + "decimals": 1, + "description": "" +}