From 0a77a28e066a0f67b9eb451a40444fe0d7609cd3 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 11 Dec 2020 11:51:42 -0500 Subject: [PATCH] guage to graph cor cpu on manager and eval https://github.com/Security-Onion-Solutions/securityonion/issues/1175 --- salt/grafana/dashboards/eval/eval.json | 135 ++++++++++++++--- salt/grafana/dashboards/manager/manager.json | 145 ++++++++++++++----- 2 files changed, 220 insertions(+), 60 deletions(-) diff --git a/salt/grafana/dashboards/eval/eval.json b/salt/grafana/dashboards/eval/eval.json index 449233508..63f88de19 100644 --- a/salt/grafana/dashboards/eval/eval.json +++ b/salt/grafana/dashboards/eval/eval.json @@ -24,18 +24,36 @@ "fieldConfig": { "defaults": { "custom": {}, - "decimals": 2, - "mappings": [], + "unit": "percent", + "min": 0, + "max": 100, "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgb(255, 255, 255)", + "color": "rgba(50, 172, 45, 0.97)", "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 60 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 80 } ] }, - "unit": "s" + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected" }, "overrides": [] }, @@ -45,23 +63,15 @@ "x": 0, "y": 0 }, - "id": 39, + "id": 2, + "links": [], "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - } + "alertThreshold": true }, - "pluginVersion": "7.0.5", + "pluginVersion": "7.3.4", "targets": [ { + "dsType": "influxdb", "groupBy": [ { "params": [ @@ -76,7 +86,7 @@ "type": "fill" } ], - "measurement": "system", + "measurement": "cpu", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -85,13 +95,19 @@ [ { "params": [ - "uptime" + "usage_idle" ], "type": "field" }, { "params": [], - "type": "last" + "type": "mean" + }, + { + "params": [ + "* -1 + 100" + ], + "type": "math" } ] ], @@ -100,14 +116,87 @@ "key": "host", "operator": "=", "value": "{{ SERVERNAME }}" + }, + { + "condition": "AND", + "key": "cpu", + "operator": "=", + "value": "cpu-total" } - ] + ], + "alias": "Usage" } ], + "title": "{{ SERVERNAME }} - CPU", + "type": "graph", + "cacheTimeout": null, + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:395" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:396" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "fillGradient": 0, + "linewidth": 1, + "dashes": false, + "hiddenSeries": false, + "dashLength": 10, + "spaceLength": 10, + "points": false, + "pointradius": 2, + "bars": false, + "stack": false, + "percentage": false, + "legend": { + "show": false, + "values": false, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": false + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, "timeFrom": null, "timeShift": null, - "title": "{{ SERVERNAME }} - System Uptime", - "type": "stat" + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [] }, { "cacheTimeout": null, diff --git a/salt/grafana/dashboards/manager/manager.json b/salt/grafana/dashboards/manager/manager.json index d0d55243f..9a498a34f 100644 --- a/salt/grafana/dashboards/manager/manager.json +++ b/salt/grafana/dashboards/manager/manager.json @@ -20,8 +20,43 @@ "links": [], "panels": [ { - "cacheTimeout": null, "datasource": "InfluxDB", + "fieldConfig": { + "defaults": { + "custom": {}, + "unit": "percent", + "min": 0, + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 60 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 80 + } + ] + }, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected" + }, + "overrides": [] + }, "gridPos": { "h": 5, "w": 4, @@ -31,40 +66,9 @@ "id": 2, "links": [], "options": { - "fieldOptions": { - "calcs": [ - "lastNotNull" - ], - "defaults": { - "mappings": [], - "max": 100, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 60 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [], - "values": false - }, - "orientation": "auto", - "showThresholdLabels": false, - "showThresholdMarkers": true + "alertThreshold": true }, - "pluginVersion": "6.6.2", + "pluginVersion": "7.3.4", "targets": [ { "dsType": "influxdb", @@ -119,13 +123,80 @@ "operator": "=", "value": "cpu-total" } - ] + ], + "alias": "Usage" } ], + "title": "{{ SERVERNAME }} - CPU", + "type": "graph", + "cacheTimeout": null, + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:395" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:396" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "fillGradient": 0, + "linewidth": 1, + "dashes": false, + "hiddenSeries": false, + "dashLength": 10, + "spaceLength": 10, + "points": false, + "pointradius": 2, + "bars": false, + "stack": false, + "percentage": false, + "legend": { + "show": false, + "values": false, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": false + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, "timeFrom": null, "timeShift": null, - "title": "{{ SERVERNAME }} - CPU", - "type": "gauge" + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [] }, { "datasource": "InfluxDB",