diff --git a/conf/glances-grafana-influxql.json b/conf/glances-grafana-influxql.json index 39380285..36b56d5e 100644 --- a/conf/glances-grafana-influxql.json +++ b/conf/glances-grafana-influxql.json @@ -7,26 +7,23 @@ "type": "datasource", "pluginId": "influxdb", "pluginName": "InfluxDB" + }, + { + "name": "DS_LSAT1", + "label": "lsat1", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" } ], + "__elements": {}, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.5.3" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "panel", - "id": "heatmap", - "name": "Heatmap", - "version": "" + "version": "10.4.1" }, { "type": "datasource", @@ -36,8 +33,8 @@ }, { "type": "panel", - "id": "singlestat", - "name": "Singlestat", + "id": "stat", + "name": "Stat", "version": "" }, { @@ -45,13 +42,22 @@ "id": "text", "name": "Text", "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" } ], "annotations": { "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -61,35 +67,48 @@ ] }, "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, - "iteration": 1622127318980, "links": [], "panels": [ { - "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": "${DS_GLANCES}", - "editable": true, - "error": false, - "fieldConfig": { - "defaults": {}, - "overrides": [] + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 6, @@ -98,43 +117,31 @@ "y": 0 }, "id": 5, - "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": false + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.4.1", "targets": [ { "column": "cpucore", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -175,82 +182,101 @@ ] } ], - "thresholds": "", "title": "Core", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { - "aliasColors": {}, - "annotate": { - "enable": false + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, - "grid": { - "max": null, - "min": null - }, "gridPos": { "h": 6, "w": 20, "x": 2, "y": 0 }, - "hiddenSeries": false, "id": 4, - "interactive": true, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "legend_counts": true, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "resolution": 100, - "scale": 1, - "seriesOverrides": [], - "spaceLength": 10, - "spyable": true, - "stack": true, - "steppedLine": false, + "pluginVersion": "10.4.1", "targets": [ { "alias": "1min", "column": "min1", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -300,6 +326,10 @@ { "alias": "5mins", "column": "min5", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -349,6 +379,10 @@ { "alias": "15mins", "column": "min15", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -396,70 +430,47 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "timezone": "browser", "title": "Load", - "tooltip": { - "query_as_alias": true, - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, - "fieldConfig": { - "defaults": {}, - "overrides": [] + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 6, @@ -468,43 +479,31 @@ "y": 0 }, "id": 18, - "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 + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.4.1", "targets": [ { "column": "total", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -545,72 +544,97 @@ ] } ], - "thresholds": "", "title": "Processes", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 6 }, - "hiddenSeries": false, "id": 6, - "legend": { - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "10.4.1", "targets": [ { "alias": "User", "column": "user", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -659,6 +683,10 @@ { "alias": "System", "column": "system", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -708,6 +736,10 @@ { "alias": "IoWait", "column": "iowait", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -755,99 +787,114 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "CPU (%)", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": { - "Max": "#BF1B00" + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, "fieldConfig": { - "defaults": {}, - "overrides": [] + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + } + ] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 6 }, - "hiddenSeries": false, "id": 7, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "10.4.1", "targets": [ { "alias": "Used", "column": "used", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -897,6 +944,10 @@ { "alias": "Max", "column": "total", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -945,104 +996,101 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "MEM", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:2371", - "format": "bytes", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:2372", - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bps" + }, "overrides": [] }, - "fill": 3, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 13 }, - "hiddenSeries": false, "id": 9, - "legend": { - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Tx", - "yaxis": 1 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.4.1", "targets": [ { "alias": "In", "column": "enp0s25.rx", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1087,6 +1135,10 @@ { "alias": "Out", "column": "eth0.tx*-1", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1129,101 +1181,114 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "$interface network interface", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:2467", - "format": "bps", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:2468", - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": { - "Max": "#BF1B00" + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, "fieldConfig": { - "defaults": {}, - "overrides": [] + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + } + ] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 13 }, - "hiddenSeries": false, "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "10.4.1", "targets": [ { "alias": "Used", "column": "used", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1261,6 +1326,10 @@ { "alias": "Max", "column": "total", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1297,104 +1366,101 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SWAP", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:2690", - "format": "bytes", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:2691", - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 20 }, - "hiddenSeries": false, "id": 10, - "legend": { - "avg": true, - "current": false, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Write", - "yaxis": 2 + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.4.1", "targets": [ { "alias": "Read", "column": "sda2.read_bytes", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1438,6 +1504,10 @@ { "alias": "Write", "column": "sda2.write_bytes", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1480,108 +1550,130 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "$disk disk IO", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:2782", - "format": "bytes", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:2783", - "format": "bytes", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": { - "Max": "#BF1B00" + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, "fieldConfig": { - "defaults": {}, - "overrides": [] + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 3, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Used" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 100 + }, + { + "id": "custom.fillOpacity", + "value": 80 + } + ] + } + ] }, - "fill": 0, - "fillGradient": 0, - "grid": {}, "gridPos": { "h": 7, "w": 8, "x": 12, "y": 20 }, - "hiddenSeries": false, "id": 11, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 3, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:3095", - "alias": "Used", - "fill": 10, - "fillGradient": 8 + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "10.4.1", "targets": [ { "alias": "Used", "column": "\"/.used\"", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1636,6 +1728,10 @@ { "alias": "Max", "column": "\"/.size\"", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1689,70 +1785,50 @@ "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "/ Size", - "tooltip": { - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:2891", - "format": "bytes", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "$$hashKey": "object:2892", - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "cacheTimeout": null, - "colorBackground": true, - "colorValue": false, - "colors": [ - "rgba(71, 212, 59, 0.4)", - "rgba(245, 150, 40, 0.73)", - "rgba(225, 40, 40, 0.59)" - ], - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, - "fieldConfig": { - "defaults": {}, - "overrides": [] + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(71, 212, 59, 0.4)", + "value": null + }, + { + "color": "rgba(245, 150, 40, 0.73)", + "value": 70 + }, + { + "color": "rgba(225, 40, 40, 0.59)", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] }, "gridPos": { "h": 7, @@ -1761,43 +1837,31 @@ "y": 20 }, "id": 16, - "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(193, 71, 31)", - "show": true + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.4.1", "targets": [ { "column": "\"/.percent\"", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1844,42 +1908,50 @@ ] } ], - "thresholds": "70,90", "title": "/ used", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": true, - "colorValue": false, - "colors": [ - "rgba(71, 212, 59, 0.4)", - "rgba(245, 150, 40, 0.73)", - "rgba(225, 40, 40, 0.59)" - ], - "datasource": "${DS_GLANCES}", - "editable": true, - "error": false, - "fieldConfig": { - "defaults": {}, - "overrides": [] + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(71, 212, 59, 0.4)", + "value": null + }, + { + "color": "rgba(245, 150, 40, 0.73)", + "value": 70 + }, + { + "color": "rgba(225, 40, 40, 0.59)", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] }, "gridPos": { "h": 7, @@ -1888,43 +1960,31 @@ "y": 20 }, "id": 17, - "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(193, 71, 31)", - "show": true + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.4.1", "targets": [ { "column": "\"/home.percent\"", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "function": "mean", "groupBy": [ @@ -1966,24 +2026,13 @@ ] } ], - "thresholds": "70,90", "title": "/boot used", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "type": "stat" }, { - "datasource": null, - "fieldConfig": { - "defaults": {}, - "overrides": [] + "datasource": { + "type": "influxdb", + "uid": "${DS_LSAT1}" }, "gridPos": { "h": 3, @@ -1992,32 +2041,88 @@ "y": 27 }, "id": 22, - "links": [], "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, "content": "", "mode": "markdown" }, - "pluginVersion": "7.5.3", + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${DS_LSAT1}" + }, + "refId": "A" + } + ], "title": "Sensors", "type": "text" }, { - "cards": { - "cardPadding": null, - "cardRound": null + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "color": { - "cardColor": "rgb(255, 0, 0)", - "colorScale": "sqrt", - "colorScheme": "interpolateReds", - "exponent": 1, - "min": null, - "mode": "opacity" - }, - "dataFormat": "timeseries", - "datasource": "${DS_GLANCES}", + "description": "", "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "celsius" + }, "overrides": [] }, "gridPos": { @@ -2026,18 +2131,27 @@ "x": 0, "y": 30 }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, "id": 21, - "legend": { - "show": false + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "links": [], - "reverseYBuckets": false, + "pluginVersion": "10.4.1", "targets": [ { - "alias": "AmbientTemperature", + "alias": "$tag_label", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "groupBy": [ { @@ -2046,6 +2160,12 @@ ], "type": "time" }, + { + "params": [ + "label::tag" + ], + "type": "tag" + }, { "params": [ "null" @@ -2073,60 +2193,84 @@ ] ], "tags": [ - { - "key": "label", - "operator": "=", - "value": "Ambient" - }, { "condition": "AND", "key": "hostname", "operator": "=~", "value": "/^$host$/" + }, + { + "condition": "AND", + "key": "type", + "operator": "=~", + "value": "/^SensorType.CPU_TEMP$/" } ] } ], - "title": "Ambiant temperature", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "celsius", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null + "title": "CPU temperature", + "type": "timeseries" }, { - "cards": { - "cardPadding": null, - "cardRound": null + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "color": { - "cardColor": "rgb(255, 0, 0)", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 1, - "mode": "opacity" - }, - "dataFormat": "timeseries", - "datasource": "${DS_GLANCES}", + "description": "", "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "rotrpm" + }, "overrides": [] }, "gridPos": { @@ -2135,18 +2279,27 @@ "x": 12, "y": 30 }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 23, - "legend": { - "show": false + "id": 32, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "links": [], - "reverseYBuckets": false, + "pluginVersion": "10.4.1", "targets": [ { - "alias": "CpuTemperature", + "alias": "$tag_label", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "dsType": "influxdb", "groupBy": [ { @@ -2155,6 +2308,12 @@ ], "type": "time" }, + { + "params": [ + "label::tag" + ], + "type": "tag" + }, { "params": [ "null" @@ -2182,52 +2341,31 @@ ] ], "tags": [ - { - "key": "label", - "operator": "=", - "value": "CPU" - }, { "condition": "AND", "key": "hostname", "operator": "=~", "value": "/^$host$/" + }, + { + "condition": "AND", + "key": "type", + "operator": "=~", + "value": "/^SensorType.FAN_SPEED$/" } ] } ], - "title": "CPU temperature", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "celsius", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null + "title": "FAN speed", + "type": "timeseries" }, { - "datasource": null, + "datasource": { + "type": "influxdb", + "uid": "${DS_LSAT1}" + }, "editable": true, "error": false, - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 3, "w": 24, @@ -2235,28 +2373,88 @@ "y": 36 }, "id": 13, - "links": [], "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, "content": "", "mode": "markdown" }, - "pluginVersion": "7.5.3", + "pluginVersion": "10.4.1", "style": {}, + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${DS_LSAT1}" + }, + "refId": "A" + } + ], "title": "Containers", "type": "text" }, { - "aliasColors": { - "$host.docker.mean": "#ba43a9", - "CPU%": "#cca300", - "MEM": "#2f575e" + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_GLANCES}", "fieldConfig": { - "defaults": {}, + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, "overrides": [ { "matcher": { @@ -2269,63 +2467,111 @@ "value": "decbytes" } ] + }, + { + "matcher": { + "id": "byName", + "options": "$host.docker.mean" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#ba43a9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "CPU%" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#cca300", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MEM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2f575e", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MEM" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MEM" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 100 + }, + { + "id": "custom.fillOpacity", + "value": 80 + } + ] } ] }, - "fill": 0, - "fillGradient": 0, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 39 }, - "hiddenSeries": false, "id": 25, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.3", - "pointradius": 5, - "points": false, - "renderer": "flot", + "pluginVersion": "10.4.1", "repeat": "container", "repeatDirection": "v", - "seriesOverrides": [ - { - "$$hashKey": "object:3517", - "alias": "MEM", - "yaxis": 2 - }, - { - "$$hashKey": "object:3518", - "alias": "MEM", - "fill": 10, - "fillGradient": 8, - "steppedLine": true, - "zindex": -3 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { "alias": "CPU%", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "groupBy": [ { "params": [ @@ -2341,7 +2587,7 @@ } ], "hide": false, - "measurement": "docker", + "measurement": "containers", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"cpu_percent\") FROM \"$host.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", @@ -2378,6 +2624,10 @@ }, { "alias": "MEM", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "groupBy": [ { "params": [ @@ -2393,7 +2643,7 @@ } ], "hide": false, - "measurement": "docker", + "measurement": "containers", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"cpu_percent\") FROM \"$host.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", @@ -2429,66 +2679,24 @@ ] } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "$container container", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:3541", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:3542", - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" } ], "refresh": "5s", - "schemaVersion": 27, - "style": "dark", + "schemaVersion": 39, "tags": [], "templating": { "list": [ { - "allValue": null, "current": {}, - "datasource": "${DS_GLANCES}", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "definition": "show tag values with key=\"hostname\"", - "description": null, - "error": null, "hide": 0, "includeAll": false, - "label": null, "multi": false, "name": "host", "options": [], @@ -2498,21 +2706,19 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false }, { - "allValue": null, "current": {}, - "datasource": "${DS_GLANCES}", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "definition": "show tag values with key=\"name\"", - "description": null, - "error": null, "hide": 0, "includeAll": true, - "label": null, "multi": true, "name": "container", "options": [], @@ -2522,21 +2728,19 @@ "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false }, { - "allValue": null, "current": {}, - "datasource": "${DS_GLANCES}", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "definition": "show tag values with key=\"interface_name\"", - "description": null, - "error": null, "hide": 0, "includeAll": false, - "label": null, "multi": false, "name": "interface", "options": [], @@ -2546,21 +2750,19 @@ "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false }, { - "allValue": null, "current": {}, - "datasource": "${DS_GLANCES}", + "datasource": { + "type": "influxdb", + "uid": "${DS_GLANCES}" + }, "definition": "show tag values with key=\"disk_name\"", - "description": null, - "error": null, "hide": 0, "includeAll": false, - "label": null, "multi": false, "name": "disk", "options": [], @@ -2570,7 +2772,6 @@ "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -2615,5 +2816,6 @@ "timezone": "browser", "title": "Glances", "uid": "000000002", - "version": 4 -} + "version": 5, + "weekStart": "" +} \ No newline at end of file diff --git a/glances/event.py b/glances/event.py index 796205f4..ea2f3cbe 100644 --- a/glances/event.py +++ b/glances/event.py @@ -32,7 +32,13 @@ Item (or event) is defined by: } """ -from pydantic.dataclasses import dataclass +from glances.logger import logger + +try: + from pydantic.dataclasses import dataclass +except ImportError as e: + logger.warning(f"Missing Python Lib ({e}), EventList will be skipping data validation") + from dataclasses import dataclass from glances.processes import sort_stats diff --git a/glances/events_list.py b/glances/events_list.py index a0d7ce26..04f6459d 100644 --- a/glances/events_list.py +++ b/glances/events_list.py @@ -11,7 +11,7 @@ import time from datetime import datetime -from pydantic import RootModel +from dataclasses import asdict from glances.processes import glances_processes from glances.thresholds import glances_thresholds @@ -201,7 +201,7 @@ class GlancesEventsList(object): def get(self): """Return the RAW events list.""" - return [RootModel[GlancesEvent](e).model_dump() for e in self.events_list] + return [asdict(e) for e in self.events_list] def len(self): """Return the number of events in the logs list.""" diff --git a/glances/exports/glances_influxdb/__init__.py b/glances/exports/glances_influxdb/__init__.py index 435038f6..b5df2708 100644 --- a/glances/exports/glances_influxdb/__init__.py +++ b/glances/exports/glances_influxdb/__init__.py @@ -18,7 +18,7 @@ from glances.exports.export import GlancesExport from influxdb import InfluxDBClient from influxdb.client import InfluxDBClientError -FIELD_TO_TAG = ['name', 'cmdline'] +FIELD_TO_TAG = ['name', 'cmdline', 'type'] class Export(GlancesExport): diff --git a/glances/exports/glances_influxdb2/__init__.py b/glances/exports/glances_influxdb2/__init__.py index 7c0af5a3..6abcfcea 100644 --- a/glances/exports/glances_influxdb2/__init__.py +++ b/glances/exports/glances_influxdb2/__init__.py @@ -17,7 +17,7 @@ from glances.exports.export import GlancesExport from influxdb_client import InfluxDBClient, WriteOptions -FIELD_TO_TAG = ['name', 'cmdline'] +FIELD_TO_TAG = ['name', 'cmdline', 'type'] class Export(GlancesExport): diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index e2914df9..9d5ae178 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -287,10 +287,13 @@ class _GlancesCurses(object): self.filter_color = curses.color_pair(9) | A_BOLD self.selected_color = curses.color_pair(10) | A_BOLD # Define separator line style - curses.init_color(11, 500, 500, 500) - curses.init_pair(11, curses.COLOR_BLACK, -1) - self.separator = curses.color_pair(11) - + try: + curses.init_color(11, 500, 500, 500) + curses.init_pair(11, curses.COLOR_BLACK, -1) + self.separator = curses.color_pair(11) + except Exception: + # Catch exception in TMUX + pass else: # The screen is NOT compatible with a colored design # switch to B&W text styles diff --git a/glances/outputs/glances_restful_api.py b/glances/outputs/glances_restful_api.py index b65f77d1..c07ccba9 100644 --- a/glances/outputs/glances_restful_api.py +++ b/glances/outputs/glances_restful_api.py @@ -16,8 +16,12 @@ from io import open import webbrowser from urllib.parse import urljoin -# Replace typing_extensions by typing when Python 3.8 support will be dropped -from typing import Annotated +try: + from typing import Annotated +except ImportError: + # Only for Python 3.8 + # To be removed when Python 3.8 support will be dropped + from typing_extensions import Annotated from glances import __version__, __apiversion__ from glances.password import GlancesPassword diff --git a/glances/plugins/sensors/__init__.py b/glances/plugins/sensors/__init__.py index 0173235a..9f1c8e6f 100644 --- a/glances/plugins/sensors/__init__.py +++ b/glances/plugins/sensors/__init__.py @@ -8,30 +8,34 @@ # """Sensors plugin.""" +from enum import Enum +from concurrent.futures import ThreadPoolExecutor +from typing import List, Dict, Literal, Any import psutil import warnings -import threading from glances.logger import logger -from glances.globals import iteritems, to_fahrenheit +from glances.globals import to_fahrenheit from glances.timer import Counter from glances.plugins.sensors.sensor.glances_batpercent import PluginModel as BatPercentPluginModel from glances.plugins.sensors.sensor.glances_hddtemp import PluginModel as HddTempPluginModel from glances.outputs.glances_unicode import unicode_message from glances.plugins.plugin.model import GlancesPluginModel -SENSOR_TEMP_TYPE = 'temperature_core' -SENSOR_TEMP_UNIT = 'C' -SENSOR_FAN_TYPE = 'fan_speed' -SENSOR_FAN_UNIT = 'R' +class SensorType(str, Enum): + # Switch to `enum.StrEnum` when we only support py311+ + CPU_TEMP = 'temperature_core' + FAN_SPEED = 'fan_speed' + HDD_TEMP = 'temperature_hdd' + BATTERY = 'battery' -SENSOR_HDDTEMP_TYPE = 'temperature_hdd' -SENSOR_HDDTEMP_UNIT = 'C' -SENSORS_BATTERY_TYPE = 'battery' -SENSORS_BATTERY_UNIT = '%' +CPU_TEMP_UNIT = 'C' +FAN_SPEED_UNIT = 'R' +HDD_TEMP_UNIT = 'C' +BATTERY_UNIT = '%' # Define the default refresh multiplicator # Default value is 3 * Glances refresh time @@ -82,28 +86,38 @@ class PluginModel(GlancesPluginModel): super(PluginModel, self).__init__( args=args, config=config, stats_init_value=[], fields_description=fields_description ) - start_duration = Counter() # Init the sensor class start_duration.reset() - # Hotfix! Refactor to use only one `GlancesGrabSensors` later - self.glances_grab_sensors_fan_speed = GlancesGrabSensors() - self.glances_grab_sensors_temperature = GlancesGrabSensors() - logger.debug("Generic sensor plugin init duration: {} seconds".format(start_duration.get())) + glances_grab_sensors_cpu_temp = GlancesGrabSensors(SensorType.CPU_TEMP) + logger.debug("CPU Temp sensor plugin init duration: {} seconds".format(start_duration.get())) - # Instance for the HDDTemp Plugin in order to display the hard disks - # temperatures start_duration.reset() - self.hddtemp_plugin = HddTempPluginModel(args=args, config=config) + glances_grab_sensors_fan_speed = GlancesGrabSensors(SensorType.FAN_SPEED) + logger.debug("Fan speed sensor plugin init duration: {} seconds".format(start_duration.get())) + + # Instance for the HDDTemp Plugin in order to display the hard disks temperatures + start_duration.reset() + hddtemp_plugin = HddTempPluginModel(args=args, config=config) logger.debug("HDDTemp sensor plugin init duration: {} seconds".format(start_duration.get())) - # Instance for the BatPercent in order to display the batteries - # capacities + # Instance for the BatPercent in order to display the batteries capacities start_duration.reset() - self.batpercent_plugin = BatPercentPluginModel(args=args, config=config) + batpercent_plugin = BatPercentPluginModel(args=args, config=config) logger.debug("Battery sensor plugin init duration: {} seconds".format(start_duration.get())) + self.sensors_grab_map: Dict[SensorType, Any] = {} + + if glances_grab_sensors_cpu_temp.init: + self.sensors_grab_map[SensorType.CPU_TEMP] = glances_grab_sensors_cpu_temp + + if glances_grab_sensors_fan_speed.init: + self.sensors_grab_map[SensorType.FAN_SPEED] = glances_grab_sensors_fan_speed + + self.sensors_grab_map[SensorType.HDD_TEMP] = hddtemp_plugin + self.sensors_grab_map[SensorType.BATTERY] = batpercent_plugin + # We want to display the stat in the curse interface self.display_curse = True @@ -115,37 +129,15 @@ class PluginModel(GlancesPluginModel): """Return the key of the list.""" return 'label' - def __get_temperature(self, stats, index): + def __get_sensor_data(self, sensor_type: SensorType) -> List[Dict]: try: - temperature = self.__set_type(self.glances_grab_sensors_temperature.get(SENSOR_TEMP_TYPE), SENSOR_TEMP_TYPE) + data = self.sensors_grab_map[sensor_type].update() + data = self.__set_type(data, sensor_type) except Exception as e: - logger.error("Cannot grab sensors temperatures (%s)" % e) + logger.error(f"Cannot grab sensors `{sensor_type}` ({e})") + return [] else: - stats[index] = self.__transform_sensors(temperature) - - def __get_fan_speed(self, stats, index): - try: - fan_speed = self.__set_type(self.glances_grab_sensors_fan_speed.get(SENSOR_FAN_TYPE), SENSOR_FAN_TYPE) - except Exception as e: - logger.error("Cannot grab FAN speed (%s)" % e) - else: - stats[index] = self.__transform_sensors(fan_speed) - - def __get_hddtemp(self, stats, index): - try: - hddtemp = self.__set_type(self.hddtemp_plugin.update(), SENSOR_HDDTEMP_TYPE) - except Exception as e: - logger.error("Cannot grab HDD temperature (%s)" % e) - else: - stats[index] = self.__transform_sensors(hddtemp) - - def __get_bat_percent(self, stats, index): - try: - bat_percent = self.__set_type(self.batpercent_plugin.update(), SENSORS_BATTERY_TYPE) - except Exception as e: - logger.error("Cannot grab battery percent (%s)" % e) - else: - stats[index] = self.__transform_sensors(bat_percent) + return self.__transform_sensors(data) def __transform_sensors(self, threads_stats): """Hide, alias and sort the result""" @@ -172,22 +164,17 @@ class PluginModel(GlancesPluginModel): stats = self.get_init_value() if self.input_method == 'local': - threads_stats = [None] * 4 - threads = [ - threading.Thread(name=SENSOR_TEMP_TYPE, target=self.__get_temperature, args=(threads_stats, 0)), - threading.Thread(name=SENSOR_FAN_TYPE, target=self.__get_fan_speed, args=(threads_stats, 1)), - threading.Thread(name=SENSOR_HDDTEMP_TYPE, target=self.__get_hddtemp, args=(threads_stats, 2)), - threading.Thread(name=SENSORS_BATTERY_TYPE, target=self.__get_bat_percent, args=(threads_stats, 3)), - ] - # Start threads in // - for t in threads: - t.start() - # Wait threads are finished - for t in threads: - t.join() + with ThreadPoolExecutor(max_workers=len(self.sensors_grab_map)) as executor: + logger.debug(f"Sensors enabled sub plugins: {list(self.sensors_grab_map.keys())}") + futures = {t: executor.submit(self.__get_sensor_data, t) for t in self.sensors_grab_map.keys()} + # Merge the results - for s in threads_stats: - stats.extend(s) + for sensor_type, future in futures.items(): + try: + stats.extend(future.result()) + except Exception as e: + logger.error(f"Cannot parse sensors data for `{sensor_type}` ({e})") + elif self.input_method == 'snmp': # Update stats using SNMP # No standard: @@ -209,7 +196,7 @@ class PluginModel(GlancesPluginModel): else: return stats["label"] - def __set_type(self, stats, sensor_type): + def __set_type(self, stats: List[Dict[str, Any]], sensor_type: SensorType) -> List[Dict[str, Any]]: """Set the plugin type. 4 types of stats is possible in the sensors plugin: @@ -237,10 +224,10 @@ class PluginModel(GlancesPluginModel): if not i['value']: continue # Alert processing - if i['type'] == SENSOR_TEMP_TYPE: - if self.is_limit('critical', stat_name=SENSOR_TEMP_TYPE + '_' + i['label']): + if i['type'] == SensorType.CPU_TEMP: + if self.is_limit('critical', stat_name=SensorType.CPU_TEMP + '_' + i['label']): # By default use the thresholds configured in the glances.conf file (see #2058) - alert = self.get_alert(current=i['value'], header=SENSOR_TEMP_TYPE + '_' + i['label']) + alert = self.get_alert(current=i['value'], header=SensorType.CPU_TEMP + '_' + i['label']) else: # Else use the system thresholds if i['critical'] is None: @@ -253,7 +240,7 @@ class PluginModel(GlancesPluginModel): alert = 'WARNING' else: alert = 'OK' - elif i['type'] == SENSORS_BATTERY_TYPE: + elif i['type'] == SensorType.BATTERY: # Battery is in % alert = self.get_alert(current=100 - i['value'], header=i['type']) else: @@ -297,7 +284,7 @@ class PluginModel(GlancesPluginModel): # Stats for i in self.stats: # Do not display anything if no battery are detected - if i['type'] == SENSORS_BATTERY_TYPE and i['value'] == []: + if i['type'] == SensorType.BATTERY and i['value'] == []: continue # New line ret.append(self.curse_new_line()) @@ -309,7 +296,7 @@ class PluginModel(GlancesPluginModel): self.curse_add_line(msg, self.get_views(item=i[self.get_key()], key='value', option='decoration')) ) else: - if args.fahrenheit and i['type'] != SENSORS_BATTERY_TYPE and i['type'] != SENSOR_FAN_TYPE: + if args.fahrenheit and i['type'] != SensorType.BATTERY and i['type'] != SensorType.FAN_SPEED: trend = '' value = to_fahrenheit(i['value']) unit = 'F' @@ -334,73 +321,42 @@ class PluginModel(GlancesPluginModel): class GlancesGrabSensors(object): """Get sensors stats.""" - def __init__(self): + def __init__(self, sensor_type: Literal[SensorType.FAN_SPEED, SensorType.CPU_TEMP]): """Init sensors stats.""" - # Temperatures - self.init_temp = False - self.sensor_temps = {} + self.sensor_type = sensor_type + self.sensor_unit = CPU_TEMP_UNIT if self.sensor_type == SensorType.CPU_TEMP else FAN_SPEED_UNIT + + self.init = False try: - # psutil>=5.1.0, Linux-only - self.sensor_temps = psutil.sensors_temperatures() + self.__fetch_psutil() + self.init = True except AttributeError: - logger.debug("Cannot grab temperatures. Platform not supported.") - else: - self.init_temp = True + logger.debug(f"Cannot grab {sensor_type}. Platform not supported.") + + def __fetch_psutil(self) -> Dict[str, list]: + if self.sensor_type == SensorType.CPU_TEMP: # Solve an issue #1203 concerning a RunTimeError warning message displayed # in the curses interface. warnings.filterwarnings("ignore") - # Fans - self.init_fan = False - self.sensor_fans = {} - try: + # psutil>=5.1.0, Linux-only + return psutil.sensors_temperatures() + + if self.sensor_type == SensorType.FAN_SPEED: # psutil>=5.2.0, Linux-only - self.sensor_fans = psutil.sensors_fans() - except AttributeError: - logger.debug("Cannot grab fans speed. Platform not supported.") - else: - self.init_fan = True + return psutil.sensors_fans() - # Init the stats - self.reset() + raise ValueError(f"Unsupported sensor_type: {self.sensor_type}") - def reset(self): - """Reset/init the stats.""" - self.sensors_list = [] - - def __update__(self): + def update(self) -> List[dict]: """Update the stats.""" - # Reset the list - self.reset() - - if not self.init_temp: - return self.sensors_list + if not self.init: + return [] # Temperatures sensors - self.sensors_list.extend(self.build_sensors_list(SENSOR_TEMP_UNIT)) - - # Fans sensors - self.sensors_list.extend(self.build_sensors_list(SENSOR_FAN_UNIT)) - - return self.sensors_list - - def build_sensors_list(self, type): - """Build the sensors list depending of the type. - - type: SENSOR_TEMP_UNIT or SENSOR_FAN_UNIT - - output: a list - """ ret = [] - if type == SENSOR_TEMP_UNIT and self.init_temp: - input_list = self.sensor_temps - self.sensor_temps = psutil.sensors_temperatures() - elif type == SENSOR_FAN_UNIT and self.init_fan: - input_list = self.sensor_fans - self.sensor_fans = psutil.sensors_fans() - else: - return ret - for chip_name, chip in iteritems(input_list): + data = self.__fetch_psutil() + for chip_name, chip in data.items(): label_index = 1 for chip_name_index, feature in enumerate(chip): sensors_current = {} @@ -413,8 +369,9 @@ class GlancesGrabSensors(object): else: sensors_current['label'] = feature.label # Sensors value, limit and unit - sensors_current['unit'] = type - sensors_current['value'] = int(getattr(feature, 'current', 0) if getattr(feature, 'current', 0) else 0) + sensors_current['unit'] = self.sensor_unit + sensors_current['value'] = int( + getattr(feature, 'current', 0) if getattr(feature, 'current', 0) else 0) system_warning = getattr(feature, 'high', None) system_critical = getattr(feature, 'critical', None) sensors_current['warning'] = int(system_warning) if system_warning is not None else None @@ -422,16 +379,3 @@ class GlancesGrabSensors(object): # Add sensor to the list ret.append(sensors_current) return ret - - def get(self, sensor_type=SENSOR_TEMP_TYPE): - """Get sensors list.""" - self.__update__() - if sensor_type == SENSOR_TEMP_TYPE: - ret = [s for s in self.sensors_list if s['unit'] == SENSOR_TEMP_UNIT] - elif sensor_type == SENSOR_FAN_TYPE: - ret = [s for s in self.sensors_list if s['unit'] == SENSOR_FAN_UNIT] - else: - # Unknown type - logger.debug("Unknown sensor type %s" % sensor_type) - ret = [] - return ret diff --git a/glances/plugins/sensors/sensor/glances_batpercent.py b/glances/plugins/sensors/sensor/glances_batpercent.py index fa69c62f..9baadf5e 100644 --- a/glances/plugins/sensors/sensor/glances_batpercent.py +++ b/glances/plugins/sensors/sensor/glances_batpercent.py @@ -13,18 +13,20 @@ import psutil from glances.logger import logger from glances.plugins.plugin.model import GlancesPluginModel +from glances.globals import LINUX # Batinfo library (optional; Linux-only) -batinfo_tag = True -try: - import batinfo -except ImportError: - logger.debug("batinfo library not found. Fallback to psutil.") +if LINUX: + batinfo_tag = True + try: + import batinfo + except ImportError: + logger.debug("batinfo library not found. Fallback to psutil.") + batinfo_tag = False +else: batinfo_tag = False -# Availability: -# Linux, Windows, FreeBSD (psutil>=5.1.0) -# macOS (psutil>=5.4.2) +# PsUtil Sensors_battery available on Linux, Windows, FreeBSD, macOS psutil_tag = True try: psutil.sensors_battery() diff --git a/optional-requirements.txt b/optional-requirements.txt index 8df5dc13..6585466d 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -22,6 +22,7 @@ podman; python_version >= "3.6" potsdb prometheus_client pycouchdb +pydantic pygal pymdstat pymongo; python_version >= "3.7" diff --git a/requirements.txt b/requirements.txt index abb29186..8581289d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ psutil>=5.6.7 defusedxml packaging ujson>=5.4.0 -pydantic