diff --git a/devenv/dashboards.yaml b/devenv/dashboards.yaml new file mode 100644 index 0000000..9f6e49a --- /dev/null +++ b/devenv/dashboards.yaml @@ -0,0 +1,11 @@ +apiVersion: 1 + +providers: + - name: 'Zabbix test dashboards' + folder: 'zabbix' + folderUid: '' + type: file + allowUiUpdates: false + updateIntervalSeconds: 60 + options: + path: /devenv/dashboards diff --git a/devenv/dashboards/template_linux_server.json b/devenv/dashboards/template_linux_server.json new file mode 100644 index 0000000..3108318 --- /dev/null +++ b/devenv/dashboards/template_linux_server.json @@ -0,0 +1,533 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "iteration": 1651660898062, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 4, + "panels": [], + "title": "CPU", + "type": "row" + }, + { + "aliasColors": { + "CPU iowait time": "#B7DBAB", + "CPU system time": "#BF1B00", + "CPU user time": "#EAB839" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "editable": true, + "error": false, + "fill": 3, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 1, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.4.7", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "CPU" + }, + "countTriggers": true, + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/CPU/" + }, + "minSeverity": 3, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "CPU", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "logBase": 1, + "max": 100, + "min": 0, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + "Processor load (1 min average per core)": "#1F78C1" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "editable": true, + "error": false, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 1 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "CPU" + }, + "countTriggers": true, + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "Processor load (15 min average per core)" + }, + "minSeverity": 3, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "System load", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "min": 0, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 5, + "panels": [], + "title": "Network", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "editable": true, + "error": false, + "fill": 3, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "maxPerRow": 3, + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": "netif", + "seriesOverrides": [ + { + "alias": "/Incoming/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggers": true, + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/$netif/" + }, + "minSeverity": 3, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Network traffic on $netif", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bps", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "revision": 1, + "schemaVersion": 35, + "style": "dark", + "tags": [ + "zabbix", + "example" + ], + "templating": { + "list": [ + { + "allFormat": "regex values", + "current": { + "selected": true, + "text": "Backend", + "value": "Backend" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "definition": "Zabbix - group", + "hide": 0, + "includeAll": false, + "label": "Group", + "multi": false, + "multiFormat": "glob", + "name": "group", + "options": [], + "query": { + "application": "", + "group": "/.*/", + "host": "", + "item": "", + "queryType": "group" + }, + "refresh": 1, + "refresh_on_load": false, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allFormat": "glob", + "current": { + "selected": true, + "text": "backend01", + "value": "backend01" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "definition": "Zabbix - host", + "hide": 0, + "includeAll": false, + "label": "Host", + "multi": false, + "multiFormat": "glob", + "name": "host", + "options": [], + "query": { + "application": "", + "group": "$group", + "host": "/.*/", + "item": "", + "queryType": "host" + }, + "refresh": 1, + "refresh_on_load": false, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allFormat": "regex values", + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "definition": "Zabbix - item", + "hide": 0, + "hideLabel": false, + "includeAll": true, + "label": "Network interface", + "multi": true, + "multiFormat": "regex values", + "name": "netif", + "options": [], + "query": { + "application": "Network interfaces", + "group": "/.*/", + "host": "$host", + "item": "/.*/", + "queryType": "item" + }, + "refresh": 1, + "refresh_on_load": false, + "regex": "/(?:Incoming|Outgoing) network traffic on (.*)/", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "3h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Template Linux Server", + "uid": "hbX4md_nk", + "version": 1, + "weekStart": "" +} diff --git a/devenv/dashboards/zabbix_datasource_features.json b/devenv/dashboards/zabbix_datasource_features.json new file mode 100644 index 0000000..2d22734 --- /dev/null +++ b/devenv/dashboards/zabbix_datasource_features.json @@ -0,0 +1,1028 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 3, + "links": [], + "liveNow": false, + "panels": [ + { + "ackEventColor": "rgb(56, 219, 156)", + "ackField": true, + "ageField": false, + "customLastChangeFormat": false, + "descriptionAtNewLine": false, + "descriptionField": true, + "fontSize": "100%", + "gridPos": { + "h": 11, + "w": 19, + "x": 0, + "y": 0 + }, + "highlightBackground": false, + "highlightNewEvents": false, + "highlightNewerThan": "1h", + "hostField": true, + "hostGroups": false, + "hostProxy": false, + "hostTechNameField": false, + "id": 4, + "lastChangeFormat": "", + "layout": "table", + "markAckEvents": false, + "okEventColor": "rgb(56, 189, 113)", + "pageSize": 10, + "problemTimeline": true, + "resizedColumns": [], + "schemaVersion": 8, + "severityField": true, + "showTags": true, + "sortProblems": "lastchange", + "statusField": true, + "statusIcon": false, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "item": { + "filter": "" + }, + "itemTag": { + "filter": "" + }, + "options": { + "acknowledged": 2, + "disableDataAlignment": false, + "hostProxy": false, + "hostsInMaintenance": false, + "limit": 1001, + "minSeverity": 0, + "showDisabledItems": false, + "skipEmptyValues": false, + "sortProblems": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "5", + "refId": "A", + "resultFormat": "time_series", + "showProblems": "problems", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Problems ", + "triggerSeverity": [ + { + "$$hashKey": "object:127", + "color": "rgb(108, 108, 108)", + "priority": 0, + "severity": "Not classified", + "show": true + }, + { + "$$hashKey": "object:128", + "color": "rgb(120, 158, 183)", + "priority": 1, + "severity": "Information", + "show": true + }, + { + "$$hashKey": "object:129", + "color": "rgb(175, 180, 36)", + "priority": 2, + "severity": "Warning", + "show": true + }, + { + "$$hashKey": "object:130", + "color": "rgb(255, 137, 30)", + "priority": 3, + "severity": "Average", + "show": true + }, + { + "$$hashKey": "object:131", + "color": "rgb(255, 101, 72)", + "priority": 4, + "severity": "High", + "show": true + }, + { + "$$hashKey": "object:132", + "color": "rgb(215, 0, 0)", + "priority": 5, + "severity": "Disaster", + "show": true + } + ], + "type": "alexanderzobnin-zabbix-triggers-panel" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 19, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^Host$/", + "values": false + }, + "textMode": "value" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "backend01" + }, + "item": { + "filter": "Host name of Zabbix agent running" + }, + "itemTag": { + "filter": "" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "table", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Text data", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 19, + "y": 6 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "8.4.7", + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Zabbix servers" + }, + "host": { + "filter": "Zabbix server" + }, + "item": { + "filter": "Load average (1m avg)" + }, + "itemTag": { + "filter": "component: cpu" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Load", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "/.*/" + }, + "item": { + "filter": "CPU system time" + }, + "itemTag": { + "filter": "" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Multiple metrics", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/CPU/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "median {item=\"aggregateBy(5m, median)\", item_key=\"\"}" + }, + "properties": [ + { + "id": "custom.drawStyle", + "value": "line" + }, + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "/.*/" + }, + "item": { + "filter": "CPU system time" + }, + "itemTag": { + "filter": "" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + }, + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [ + { + "$$hashKey": "object:577", + "def": { + "category": "Aggregate", + "defaultParams": [ + "1m", + "avg" + ], + "name": "aggregateBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "5m", + "median" + ], + "text": "aggregateBy(5m, median)" + }, + { + "$$hashKey": "object:578", + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "median" + ], + "text": "setAlias(median)" + } + ], + "group": { + "filter": "Linux servers" + }, + "hide": false, + "host": { + "filter": "/.*/" + }, + "item": { + "filter": "CPU system time" + }, + "itemTag": { + "filter": "" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Functions", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd", + "seriesBy": "last" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Zabbix servers" + }, + "host": { + "filter": "Zabbix server" + }, + "item": { + "filter": "Load average (15m avg)" + }, + "itemTag": { + "filter": "component: cpu" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Load", + "type": "timeseries" + }, + { + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd", + "seriesBy": "last" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": -2, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/CPU/" + }, + "properties": [ + { + "id": "custom.axisSoftMax", + "value": 300 + }, + { + "id": "max" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "PCAF1C06DCF802728" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "/.*/" + }, + "item": { + "filter": "/CPU .* time/" + }, + "itemTag": { + "filter": "" + }, + "options": { + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "trigger": { + "filter": "" + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Stack", + "type": "timeseries" + } + ], + "schemaVersion": 35, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Zabbix data source features", + "uid": "u9mWZdlnk", + "version": 6, + "weekStart": "" +} diff --git a/devenv/datasources.yaml b/devenv/datasources.yaml new file mode 100644 index 0000000..f392ee4 --- /dev/null +++ b/devenv/datasources.yaml @@ -0,0 +1,15 @@ +apiVersion: 1 + +datasources: + - name: zabbix + type: alexanderzobnin-zabbix-datasource + access: proxy + url: http://zabbix-web:8080/api_jsonrpc.php + isDefault: true + jsonData: + username: Admin + trends: true + trendsFrom: "7d" + trendsRange: "4d" + secureJsonData: + password: zabbix diff --git a/devenv/grafana.ini b/devenv/grafana.ini new file mode 100644 index 0000000..062f4ef --- /dev/null +++ b/devenv/grafana.ini @@ -0,0 +1,10 @@ +app_mode = development + +[log] +level = debug + +[plugins] +enable_alpha = true + +[plugin.alexanderzobnin-zabbix-datasource] +path = /grafana-zabbix diff --git a/devenv/zabbix60/docker-compose.yml b/devenv/zabbix60/docker-compose.yml index 8886f83..dc81139 100644 --- a/devenv/zabbix60/docker-compose.yml +++ b/devenv/zabbix60/docker-compose.yml @@ -1,6 +1,18 @@ version: "3" services: + # Grafana + grafana: + image: grafana/grafana:8.4.7 + ports: + - "3001:3000" + volumes: + - ../..:/grafana-zabbix + - ../dashboards:/devenv/dashboards + - ../grafana.ini:/etc/grafana/grafana.ini:ro + - "../datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml" + - "../dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml" + # Zabbix zabbix-server: image: zabbix/zabbix-server-pgsql:alpine-6.0-latest