diff --git a/imageroot/etc/dashboards/malware.json b/imageroot/etc/dashboards/malware.json index 2597fb0..b2efb6a 100644 --- a/imageroot/etc/dashboards/malware.json +++ b/imageroot/etc/dashboards/malware.json @@ -1,59 +1,4 @@ { - "__inputs": [ - { - "name": "DS_GRAFANA-POSTGRESQL-DATASOURCE", - "label": "grafana-postgresql-datasource", - "description": "", - "type": "datasource", - "pluginId": "grafana-postgresql-datasource", - "pluginName": "PostgreSQL" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "panel", - "id": "barchart", - "name": "Bar chart", - "version": "" - }, - { - "type": "panel", - "id": "geomap", - "name": "Geomap", - "version": "" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "10.3.3" - }, - { - "type": "datasource", - "id": "grafana-postgresql-datasource", - "name": "PostgreSQL", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "piechart", - "name": "Pie chart", - "version": "" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -73,14 +18,15 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, + "id": 4, "links": [], "liveNow": false, "panels": [ { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -100,8 +46,7 @@ "value": 80 } ] - }, - "unitScale": true + } }, "overrides": [] }, @@ -117,6 +62,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -128,17 +74,17 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT count(*) as total FROM ts_malware WHERE $__timeFilter(time) and unit_id='$unit_id'\n", + "rawSql": "SELECT count(*) as total FROM ts_malware WHERE $__timeFilter(time) and unit_id in ($unit_id)\n", "refId": "A", "sql": { "columns": [ @@ -164,8 +110,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -206,8 +153,7 @@ "value": 80 } ] - }, - "unitScale": true + } }, "overrides": [] }, @@ -244,12 +190,12 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT src, COUNT(*) AS block_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP BY src\nORDER BY block_count DESC\nLIMIT 10", + "rawSql": "SELECT src, COUNT(*) AS block_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP BY src\nORDER BY block_count DESC\nLIMIT 10", "refId": "A", "sql": { "columns": [ @@ -275,8 +221,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -290,8 +237,7 @@ "viz": false } }, - "mappings": [], - "unitScale": true + "mappings": [] }, "overrides": [] }, @@ -325,12 +271,12 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT chain AS direction, COUNT(*) AS entry_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP BY chain\n", + "rawSql": "SELECT chain AS direction, COUNT(*) AS entry_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP BY chain\n", "refId": "A", "sql": { "columns": [ @@ -356,8 +302,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -371,8 +318,7 @@ "viz": false } }, - "mappings": [], - "unitScale": true + "mappings": [] }, "overrides": [] }, @@ -406,12 +352,12 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT category, COUNT(*) AS entry_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP BY category\n", + "rawSql": "SELECT category, COUNT(*) AS entry_count\nFROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP BY category\n", "refId": "A", "sql": { "columns": [ @@ -437,8 +383,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -466,8 +413,7 @@ "value": 80 } ] - }, - "unitScale": true + } }, "overrides": [] }, @@ -550,17 +496,17 @@ "zoom": 15 } }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT count(*) as count, country as lookup FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP BY country", + "rawSql": "SELECT count(*) as count, country as lookup FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP BY country", "refId": "A", "sql": { "columns": [ @@ -586,8 +532,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -601,6 +548,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -639,8 +587,7 @@ "value": 80 } ] - }, - "unitScale": true + } }, "overrides": [] }, @@ -667,12 +614,12 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT time_bucket('10m', time) as interval_10_miunutes, count(*) FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP by interval_10_miunutes", + "rawSql": "SELECT time_bucket('10m', time) as interval_10_miunutes, count(*) FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP by interval_10_miunutes", "refId": "A", "sql": { "columns": [ @@ -698,8 +645,9 @@ }, { "datasource": { + "default": false, "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "fieldConfig": { "defaults": { @@ -741,8 +689,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -779,12 +726,12 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT country, count(*) as count FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id='$unit_id'\nGROUP by country\nORDER by count desc\nLIMIT 10", + "rawSql": "SELECT country, count(*) as count FROM ts_malware\nWHERE $__timeFilter(time) AND unit_id IN ($unit_id)\nGROUP by country\nORDER by count desc\nLIMIT 10", "refId": "A", "sql": { "columns": [ @@ -815,15 +762,20 @@ "templating": { "list": [ { - "current": {}, + "allValue": "select distinct(unit_id) from units", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, "datasource": { "type": "grafana-postgresql-datasource", - "uid": "${DS_GRAFANA-POSTGRESQL-DATASOURCE}" + "uid": "f90e9ed5-a116-4337-bb98-5a3099bc25ee" }, "definition": "select id as __value, uuid as __text from units", "description": "", "hide": 0, - "includeAll": false, + "includeAll": true, "label": "UnitId", "multi": false, "name": "unit_id", @@ -838,13 +790,13 @@ ] }, "time": { - "from": "now-6h", + "from": "now-1h", "to": "now" }, "timepicker": {}, - "timezone": "", + "timezone": "utc", "title": "Malware", "uid": "dd395331-5dc0-4172-b243-8646c0ca3ccd", - "version": 16, + "version": 20, "weekStart": "" } \ No newline at end of file