From 1c460cc19c822d74c69908d95234a86f36f3b861 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 22 Jul 2021 10:31:47 -0400 Subject: [PATCH] fix traffic overview graphs --- ...interface_traffic_inbound_graph.json.jinja | 34 ++--- ...nterface_traffic_outbound_graph.json.jinja | 28 ++-- ...interface_traffic_inbound_graph.json.jinja | 142 +++++++----------- 3 files changed, 84 insertions(+), 120 deletions(-) diff --git a/salt/grafana/panels/management_interface_traffic_inbound_graph.json.jinja b/salt/grafana/panels/management_interface_traffic_inbound_graph.json.jinja index f6a396ea2..287666290 100644 --- a/salt/grafana/panels/management_interface_traffic_inbound_graph.json.jinja +++ b/salt/grafana/panels/management_interface_traffic_inbound_graph.json.jinja @@ -6,6 +6,7 @@ }, "dashLength": 10, "datasource": "InfluxDB", + "decimals": 1, "editable": true, "fieldConfig": { "defaults": { @@ -23,9 +24,9 @@ "interval": "30s", "legend": { "alignAsTable": true, - "avg": true, + "avg": false, "current": true, - "max": true, + "max": false, "min": false, "rightSide": true, "show": true, @@ -40,7 +41,7 @@ "maxDataPoints": 750, "nullPointMode": "connected", "options": { - "alertThreshold": true + "alertThreshold": false }, "pluginVersion": "7.5.4", "pointradius": 5, @@ -49,7 +50,7 @@ "spaceLength": 10, "targets": [ { - "alias": "$tag_host $tag_role $manint", + "alias": "$tag_host $tag_role", "dsType": "influxdb", "groupBy": [ { @@ -59,16 +60,16 @@ "type": "time" }, { - "type": "tag", "params": [ "host" - ] + ], + "type": "tag" }, { - "type": "tag", "params": [ "role" - ] + ], + "type": "tag" }, { "params": [ @@ -80,6 +81,8 @@ "measurement": "net", "orderByTime": "ASC", "policy": "default", + "query": "SELECT non_negative_derivative(mean(\"bytes_recv\"), 1s) *8 FROM \"net\" WHERE (\"host\" = '$servername' AND \"interface\" = '$manint') AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ @@ -126,9 +129,7 @@ "operator": "=~", "value": "/^$role$/" } - ], - "query": "SELECT non_negative_derivative(mean(\"bytes_recv\"), 1s) *8 FROM \"net\" WHERE (\"host\" = '$servername' AND \"interface\" = '$manint') AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false + ] } ], "thresholds": [], @@ -150,29 +151,28 @@ }, "yaxes": [ { + "$$hashKey": "object:353", + "decimals": 1, "format": "bps", "logBase": 1, "max": null, "min": 0, - "show": true, - "$$hashKey": "object:353", - "decimals": 1 + "show": true }, { + "$$hashKey": "object:354", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true, - "$$hashKey": "object:354" + "show": true } ], "yaxis": { "align": false, "alignLevel": null }, - "decimals": 1, "bars": false, "dashes": false, "error": false, diff --git a/salt/grafana/panels/management_interface_traffic_outbound_graph.json.jinja b/salt/grafana/panels/management_interface_traffic_outbound_graph.json.jinja index 045c3e7a1..87ad16750 100644 --- a/salt/grafana/panels/management_interface_traffic_outbound_graph.json.jinja +++ b/salt/grafana/panels/management_interface_traffic_outbound_graph.json.jinja @@ -6,6 +6,7 @@ }, "dashLength": 10, "datasource": "InfluxDB", + "decimals": 1, "editable": true, "fieldConfig": { "defaults": { @@ -23,9 +24,9 @@ "interval": "30s", "legend": { "alignAsTable": true, - "avg": true, + "avg": false, "current": true, - "max": true, + "max": false, "min": false, "rightSide": true, "show": true, @@ -40,7 +41,7 @@ "maxDataPoints": 750, "nullPointMode": "connected", "options": { - "alertThreshold": true + "alertThreshold": false }, "pluginVersion": "7.5.4", "pointradius": 5, @@ -49,7 +50,7 @@ "spaceLength": 10, "targets": [ { - "alias": "$tag_host $tag_role $manint", + "alias": "$tag_host $tag_role", "dsType": "influxdb", "groupBy": [ { @@ -59,16 +60,16 @@ "type": "time" }, { - "type": "tag", "params": [ "host" - ] + ], + "type": "tag" }, { - "type": "tag", "params": [ "role" - ] + ], + "type": "tag" }, { "params": [ @@ -148,29 +149,28 @@ }, "yaxes": [ { + "$$hashKey": "object:353", + "decimals": 1, "format": "bps", "logBase": 1, "max": null, "min": 0, - "show": true, - "$$hashKey": "object:353", - "decimals": 1 + "show": true }, { + "$$hashKey": "object:354", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true, - "$$hashKey": "object:354" + "show": true } ], "yaxis": { "align": false, "alignLevel": null }, - "decimals": 1, "bars": false, "dashes": false, "error": false, diff --git a/salt/grafana/panels/monitor_interface_traffic_inbound_graph.json.jinja b/salt/grafana/panels/monitor_interface_traffic_inbound_graph.json.jinja index bc84d89d1..6ef26c5ee 100644 --- a/salt/grafana/panels/monitor_interface_traffic_inbound_graph.json.jinja +++ b/salt/grafana/panels/monitor_interface_traffic_inbound_graph.json.jinja @@ -2,61 +2,55 @@ "aliasColors": { "InBound": "#629E51", "OutBound": "#5195CE", - "net.non_negative_derivative": "light-orange" + "net.non_negative_derivative": "super-light-blue" }, - "bars": false, - "maxDataPoints": 750, - "interval": "30s", "dashLength": 10, - "dashes": false, "datasource": "InfluxDB", + "decimals": 1, "editable": true, - "error": false, "fieldConfig": { "defaults": { "links": [] }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "x": {{ PANELS.monitor_interface_traffic_inbound_graph.gridPos.x }}, "y": {{ PANELS.monitor_interface_traffic_inbound_graph.gridPos.y }}, "w": {{ PANELS.monitor_interface_traffic_inbound_graph.gridPos.w }}, "h": {{ PANELS.monitor_interface_traffic_inbound_graph.gridPos.h }} }, - "hiddenSeries": false, - "id": 111845, + "id": 188188, + "interval": "30s", "legend": { "alignAsTable": true, - "avg": true, + "avg": false, "current": true, - "max": true, - "min": true, + "max": false, + "min": false, + "rightSide": true, "show": true, + "sort": "current", + "sortDesc": true, "total": false, "values": true }, "lines": true, "linewidth": 2, "links": [], + "maxDataPoints": 750, "nullPointMode": "connected", "options": { - "alertThreshold": true + "alertThreshold": false }, - "percentage": false, "pluginVersion": "7.5.4", "pointradius": 5, - "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { - "alias": "Inbound Current", + "alias": "$tag_host $tag_role", "dsType": "influxdb", "groupBy": [ { @@ -65,6 +59,18 @@ ], "type": "time" }, + { + "params": [ + "host" + ], + "type": "tag" + }, + { + "params": [ + "role" + ], + "type": "tag" + }, { "params": [ "null" @@ -75,6 +81,8 @@ "measurement": "net", "orderByTime": "ASC", "policy": "default", + "query": "SELECT non_negative_derivative(mean(\"bytes_recv\"), 1s) *8 FROM \"net\" WHERE (\"host\" = '$servername' AND \"interface\" = '$monint') AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ @@ -106,90 +114,31 @@ "tags": [ { "key": "host", - "operator": "=", - "value": "$servername" + "operator": "=~", + "value": "/^$servername$/" }, { "condition": "AND", "key": "interface", - "operator": "=", - "value": "$monint" - } - ] - }, - { - "alias": "Inbound Trend", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "net", - "orderByTime": "ASC", - "policy": "so_long_term", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "mean_bytes_recv" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "1s" - ], - "type": "non_negative_derivative" - }, - { - "params": [ - "*8" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" + "operator": "=~", + "value": "/^$monint$/" }, { "condition": "AND", - "key": "interface", - "operator": "=", - "value": "$monint" + "key": "role", + "operator": "=~", + "value": "/^$role$/" } ] } ], "thresholds": [], - "timeFrom": null, "timeRegions": [], - "timeShift": null, - "title": "Monitor Interface Inbound Traffic", + "title": "Monitor Interface Traffic - Inbound", "tooltip": { "msResolution": true, "shared": true, - "sort": 0, + "sort": 2, "value_type": "cumulative" }, "type": "graph", @@ -202,13 +151,16 @@ }, "yaxes": [ { + "$$hashKey": "object:353", + "decimals": 1, "format": "bps", "logBase": 1, "max": null, - "min": null, + "min": 0, "show": true }, { + "$$hashKey": "object:354", "format": "short", "label": null, "logBase": 1, @@ -220,5 +172,17 @@ "yaxis": { "align": false, "alignLevel": null - } + }, + "bars": false, + "dashes": false, + "error": false, + "fill": 0, + "fillGradient": 0, + "hiddenSeries": false, + "percentage": false, + "points": false, + "stack": false, + "steppedLine": false, + "timeFrom": null, + "timeShift": null }