From 619022ef7f090a5e573601091ca1cb33df02bbde Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 12 Jul 2021 11:09:23 -0400 Subject: [PATCH] 2 new panels to overview --- salt/grafana/defaults.yaml | 12 ++ .../monitor_traffic_singlestat.json.jinja | 137 ++++++++++++++++++ .../pcap_retention_singlestat.json.jinja | 126 ++++++++++++++++ 3 files changed, 275 insertions(+) create mode 100644 salt/grafana/panels/monitor_traffic_singlestat.json.jinja create mode 100644 salt/grafana/panels/pcap_retention_singlestat.json.jinja diff --git a/salt/grafana/defaults.yaml b/salt/grafana/defaults.yaml index 02fb3eafa..21f421571 100644 --- a/salt/grafana/defaults.yaml +++ b/salt/grafana/defaults.yaml @@ -84,6 +84,12 @@ grafana: y: 5 h: 4 w: 4 + monitor_traffic_singlestat: + gridPos: + x: 4 + y: 5 + h: 4 + w: 4 cpu_usage_guage: gridPos: x: 8 @@ -114,6 +120,12 @@ grafana: y: 5 h: 4 w: 2 + pcap_retention_singlestat: + gridPos: + x: 18 + y: 5 + h: 4 + w: 2 row_docker_details: gridPos: diff --git a/salt/grafana/panels/monitor_traffic_singlestat.json.jinja b/salt/grafana/panels/monitor_traffic_singlestat.json.jinja new file mode 100644 index 000000000..8a7985a59 --- /dev/null +++ b/salt/grafana/panels/monitor_traffic_singlestat.json.jinja @@ -0,0 +1,137 @@ +{ + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "InfluxDB", + "decimals": 2, + "editable": true, + "error": false, + "format": "bps", + "gauge": {}, + "gridPos": { + "x": {{ PANELS.monitor_traffic_singlestat.gridPos.x }}, + "y": {{ PANELS.monitor_traffic_singlestat.gridPos.y }}, + "w": {{ PANELS.monitor_traffic_singlestat.gridPos.w }}, + "h": {{ PANELS.monitor_traffic_singlestat.gridPos.h }} + }, + "height": "150", + "id": 24, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "net", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "bytes_recv" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "*8" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "host", + "operator": "=", + "value": "$servername" + }, + { + "condition": "AND", + "key": "interface", + "operator": "=", + "value": "$monint" + } + ] + } + ], + "thresholds": ".5,3,5", + "title": "Monitor Traffic", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current", + "fieldConfig": { + "defaults": {}, + "overrides": [] + } +} diff --git a/salt/grafana/panels/pcap_retention_singlestat.json.jinja b/salt/grafana/panels/pcap_retention_singlestat.json.jinja new file mode 100644 index 000000000..80cb8dedb --- /dev/null +++ b/salt/grafana/panels/pcap_retention_singlestat.json.jinja @@ -0,0 +1,126 @@ +{ + "colorValue": true, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "InfluxDB", + "editable": true, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "x": {{ PANELS.pcap_retention_singlestat.gridPos.x }}, + "y": {{ PANELS.pcap_retention_singlestat.gridPos.y }}, + "w": {{ PANELS.pcap_retention_singlestat.gridPos.w }}, + "h": {{ PANELS.pcap_retention_singlestat.gridPos.h }} + }, + "height": "150", + "id": 26, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "postfixFontSize": "50%", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "pcapage", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "seconds" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "host", + "operator": "=", + "value": "$servername" + } + ], + "orderByTime": "ASC" + } + ], + "thresholds": "", + "title": "PCAP Retention", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "cacheTimeout": null, + "colorBackground": false, + "decimals": 0, + "error": false, + "interval": null, + "nullText": null, + "postfix": "", + "prefix": "", + "tableColumn": "" +}