diff --git a/README.md b/README.md index 931ec05..f238f9f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ Create a user that is part of the group: `/user add name=prometheus group=prometheus password=TOP_SECRET` +Because the library makes a new connection for every API request, your logs are getting cluttered: + +`system logging set 0 topics=info,!account` ## Prepare Raspi diff --git a/docker-compose.yml b/docker-compose.yml index 7ae558c..cb5ee5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ version: "3.9" volumes: prometheus_data: {} + grafana_data: {} services: @@ -36,3 +37,25 @@ services: - default labels: org.label-schema.group: "monitoring" + + # Grafana + # https://github.com/stefanprodan/dockprom + grafana: + image: grafana/grafana:8.0.4 + container_name: grafana + volumes: + - grafana_data:/var/lib/grafana + - ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards + - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources + environment: + - GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin} + - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin} + - GF_USERS_ALLOW_SIGN_UP=false + restart: unless-stopped + ports: + - 3000:3000 + - 80:3000 + networks: + - default + labels: + org.label-schema.group: "monitoring" \ No newline at end of file diff --git a/grafana/provisioning/dashboards/dashboard.yml b/grafana/provisioning/dashboards/dashboard.yml new file mode 100644 index 0000000..fd381ee --- /dev/null +++ b/grafana/provisioning/dashboards/dashboard.yml @@ -0,0 +1,13 @@ + +apiVersion: 1 + +providers: + - name: 'Prometheus' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + allowUiUpdates: true + options: + path: /etc/grafana/provisioning/dashboards \ No newline at end of file diff --git a/grafana/provisioning/dashboards/monitor.json b/grafana/provisioning/dashboards/monitor.json new file mode 100644 index 0000000..3028233 --- /dev/null +++ b/grafana/provisioning/dashboards/monitor.json @@ -0,0 +1,3070 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Mikrotik RouterOS metrics", + "editable": true, + "gnetId": 10950, + "graphTooltip": 0, + "id": 1, + "iteration": 1584281091150, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 24, + "panels": [], + "repeat": null, + "title": "Dashboard Row", + "type": "row" + }, + { + "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": "Prometheus", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 32, + "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 + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "General" + }, + "expr": "sysName{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "System version and hw" + }, + "legendFormat": "{{sysName}}", + "mode": 2, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "System Identity", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "name" + }, + { + "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": "Prometheus", + "decimals": null, + "format": "dtdurations", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 37, + "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 + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "General" + }, + "expr": "mikrotik_system_uptime{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "System uptime" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "System uptime", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 1 + }, + "id": 38, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "General" + }, + "expr": "mikrotik_dhcp_leases_active_count{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "DHCP leases" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "DHCP leases", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "editable": true, + "error": false, + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 1 + }, + "id": 39, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "CPU" + }, + "expr": "mikrotik_system_cpu_load{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "CPU 1 load" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "50,80", + "title": "CPU load", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "decimals": 2, + "editable": true, + "error": false, + "format": "decbytes", + "gauge": { + "maxValue": 64000000, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 1 + }, + "id": 40, + "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": true, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Memory" + }, + "expr": "mikrotik_system_total_memory{address=\"$node\"} - mikrotik_system_free_memory{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "instant": false, + "intervalFactor": 1, + "item": { + "filter": "Used memory" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "32000000, 55000000", + "title": "Used RAM", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 1 + }, + "id": 46, + "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 + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "General" + }, + "expr": "mikrotik_system_uptime{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "System version and hw" + }, + "legendFormat": "{{version}} on {{boardname}}", + "mode": 2, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "System version and hw", + "type": "singlestat", + "valueFontSize": "30%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "name" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 4 + }, + "id": 25, + "panels": [], + "repeat": null, + "title": "System", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 5 + }, + "hiddenSeries": false, + "id": 35, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "CPU" + }, + "expr": "mikrotik_system_cpu_load{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "CPU 1 load" + }, + "legendFormat": "", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU load", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": null, + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "Total memory": "#E24D42", + "Used memory": "#1F78C1" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fill": 5, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 6, + "x": 8, + "y": 5 + }, + "hiddenSeries": false, + "id": 36, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Total memory", + "color": "#E24D42", + "fill": 2, + "linewidth": 0, + "zindex": -3 + }, + { + "alias": "Used memory", + "color": "#1F78C1" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Memory" + }, + "expr": "mikrotik_system_total_hdd_space{address=\"$node\"} - mikrotik_system_free_hdd_space{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "Used memory" + }, + "legendFormat": "Used memory", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "application": { + "filter": "Memory" + }, + "expr": "mikrotik_system_total_hdd_space{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "Total memory" + }, + "legendFormat": "Total memory", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Used memory", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 10, + "x": 14, + "y": 5 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 1, + "points": true, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "ICMP loss", + "lines": true, + "points": false, + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "ICMP" + }, + "expr": "probe_icmp_duration_seconds{instance=\"$node\",phase=\"rtt\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "ICMP response time" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "expr": "1-avg_over_time(probe_success{instance=\"$node\",job=\"blackbox\"}[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "ICMP loss", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ICMP response time", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": "ICMP response time", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "percent", + "label": "ICMP loss", + "logBase": 1, + "max": "100", + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 26, + "panels": [], + "repeat": null, + "title": "Network", + "type": "row" + }, + { + "aliasColors": { + "Incoming traffic on interface ether1-gateway": "#1F78C1", + "Outgoing traffic on interface ether1-gateway": "#EAB839" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fill": 3, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 41, + "legend": { + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/In/" + }, + { + "alias": "/Out/", + "color": "#EAB839", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Network" + }, + "expr": "rate(mikrotik_interface_rx_byte{address=\"$node\"}[4m])", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "Incoming traffic on interface ether1-gateway" + }, + "legendFormat": "In - {{ interface }}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "application": { + "filter": "Network" + }, + "expr": "rate(mikrotik_interface_tx_byte{address=\"$node\"}[4m])", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "Outgoing traffic on interface ether1-gateway" + }, + "legendFormat": "Out - {{ interface }}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Traffic", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [ + { + "text": "Current", + "value": "current" + } + ], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 34, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": true + }, + "styles": [ + { + "alias": "Active Address", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "activeaddress", + "preserveFormat": false, + "sanitize": false, + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Active MAC Address", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "activemacaddress", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Hostname", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "hostname", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Status", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "status", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Expires After", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "expiresafter", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "/.*/", + "thresholds": [], + "type": "hidden", + "unit": "short" + } + ], + "targets": [ + { + "expr": "mikrotik_dhcp_leases_metrics{address=\"$node\"}", + "format": "table", + "instant": true, + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "DHCP Leases", + "transform": "table", + "type": "table" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 27, + "panels": [], + "repeat": null, + "title": "Interface status", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 21 + }, + "hiddenSeries": false, + "id": 42, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Network" + }, + "expr": "mikrotik_interface_rx_error{address=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/errors on interface/" + }, + "legendFormat": "InErrors {{interface}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "expr": "mikrotik_interface_tx_error{address=\"$node\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Out Errors {{interface}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Errors", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [ + { + "text": "Current", + "value": "current" + } + ], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 6, + "x": 12, + "y": 21 + }, + "id": 44, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": false + }, + "styles": [ + { + "alias": "Interface", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Metric", + "type": "string" + }, + { + "alias": "", + "align": "auto", + "colorMode": "row", + "colors": [ + "rgba(104, 115, 104, 0)", + "rgb(41, 97, 34)", + "rgba(245, 54, 54, 0.9)" + ], + "decimals": 0, + "pattern": "Current", + "thresholds": [ + "0.1" + ], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "expr": "mikrotik_monitor_status{address=\"$node\"}", + "legendFormat": "{{interface}}", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Interface status (operational)", + "transform": "timeseries_aggregations", + "type": "table" + }, + { + "columns": [ + { + "text": "Current", + "value": "current" + } + ], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 6, + "x": 18, + "y": 21 + }, + "id": 45, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": false + }, + "styles": [ + { + "alias": "Interface", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Metric", + "type": "string" + }, + { + "alias": "Rate", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(104, 115, 104, 0)", + "rgb(41, 97, 34)", + "rgba(245, 54, 54, 0.9)" + ], + "decimals": 0, + "pattern": "Current", + "thresholds": [ + "0.0" + ], + "type": "number", + "unit": "none" + } + ], + "targets": [ + { + "expr": "mikrotik_monitor_rate{address=\"$node\"}", + "legendFormat": "{{interface}}", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Interface rate", + "transform": "timeseries_aggregations", + "type": "table" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 28, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 57 + }, + "id": 15, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/Outgoing traffic/", + "stack": "B", + "transform": "negative-Y" + }, + { + "alias": "/Incoming traffic/", + "stack": "A" + } + ], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "-rate(mtxrWlRtabRxBytes{instance=\"$node\"}[4m])", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Transform", + "defaultParams": [ + 100 + ], + "name": "scale", + "params": [ + { + "name": "factor", + "options": [ + 100, + 0.01, + 10, + -1 + ], + "type": "float" + } + ] + }, + "params": [ + "8" + ], + "text": "scale(8)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Incoming traffic/" + }, + "legendFormat": "RX {{mtxrWlRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "application": { + "filter": "Wireless" + }, + "expr": "rate(mtxrWlRtabTxBytes{instance=\"$node\"}[4m])", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Transform", + "defaultParams": [ + 100 + ], + "name": "scale", + "params": [ + { + "name": "factor", + "options": [ + 100, + 0.01, + 10, + -1 + ], + "type": "float" + } + ] + }, + "params": [ + "8" + ], + "text": "scale(8)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Outgoing traffic/" + }, + "legendFormat": "TX {{mtxrWlRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "B" + }, + { + "application": { + "filter": "Wireless" + }, + "expr": "-rate(mtxrWlCMRtabRxBytes{instance=\"$node\"}[4m])", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Transform", + "defaultParams": [ + 100 + ], + "name": "scale", + "params": [ + { + "name": "factor", + "options": [ + 100, + 0.01, + 10, + -1 + ], + "type": "float" + } + ] + }, + "params": [ + "8" + ], + "text": "scale(8)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Incoming traffic/" + }, + "legendFormat": "RX {{mtxrWlCMRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "C" + }, + { + "application": { + "filter": "Wireless" + }, + "expr": "rate(mtxrWlCMRtabTxBytes{instance=\"$node\"}[4m])", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Transform", + "defaultParams": [ + 100 + ], + "name": "scale", + "params": [ + { + "name": "factor", + "options": [ + 100, + 0.01, + 10, + -1 + ], + "type": "float" + } + ] + }, + "params": [ + "8" + ], + "text": "scale(8)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Outgoing traffic/" + }, + "legendFormat": "TX {{mtxrWlCMRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "D" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Device traffic", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "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)" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 57 + }, + "height": "100", + "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, + "options": {}, + "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 + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlApSsid{instance=\"$node\",ifDescr=\"wlan1\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "AP SSID" + }, + "legendFormat": "{{mtxrWlApSsid}}", + "mode": 2, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "SSID", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [], + "valueName": "name" + }, + { + "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": "Prometheus", + "format": "dB", + "gauge": { + "maxValue": 0, + "minValue": -200, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 57 + }, + "height": "100", + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlApNoiseFloor{instance=\"$node\",ifDescr=\"wlan1\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "hide": false, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "AP noise floor" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "-95, -89", + "title": "AP noise floor", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 60 + }, + "height": "100", + "id": 20, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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 + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlApBand{instance=\"$node\",ifDescr=\"wlan1\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "AP frequency" + }, + "legendFormat": "{{mtxrWlApBand}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "AP frequency", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "name" + }, + { + "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": "Prometheus", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 60 + }, + "height": "100", + "id": 19, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlRtabEntryCount{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "AP client count" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "AP client count", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "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": "Prometheus", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 21, + "y": 60 + }, + "height": "100", + "id": 31, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlCMRtabEntryCount{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "AP client count" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": "", + "title": "CAPsMAN client count", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + } + ], + "repeat": null, + "title": "Wireless", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 29, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 58 + }, + "height": "", + "id": 14, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlRtabStrength{instance=\"$node\"}", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/Signal strength \\((.*)\\)/", + "$1" + ], + "text": "replaceAlias(/Signal strength \\((.*)\\)/, $1)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Signal strength/" + }, + "legendFormat": "{{mtxrWlRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + }, + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlCMRtabRxStrength{instance=\"$node\"}", + "format": "time_series", + "functions": [ + { + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/Signal strength \\((.*)\\)/", + "$1" + ], + "text": "replaceAlias(/Signal strength \\((.*)\\)/, $1)" + } + ], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Signal strength/" + }, + "legendFormat": "{{mtxrWlCMRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "B" + } + ], + "thresholds": [ + { + "colorMode": "warning", + "fill": true, + "line": true, + "op": "lt", + "value": -65, + "yaxis": "left" + }, + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "lt", + "value": -75, + "yaxis": "left" + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Signal strength", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "dBm", + "label": null, + "logBase": 1, + "max": "0", + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": 0, + "cardRound": 0 + }, + "color": { + "cardColor": "rgb(174, 191, 255)", + "colorScale": "sqrt", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "timeseries", + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 58 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 23, + "legend": { + "show": false + }, + "links": [], + "maxDataPoints": "10000", + "options": {}, + "reverseYBuckets": false, + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlRtabStrength{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Signal strength/" + }, + "legendFormat": "", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + }, + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlCMRtabRxStrength{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Signal strength/" + }, + "legendFormat": "", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "B", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "title": "Signal strength heatmap", + "tooltip": { + "show": true, + "showHistogram": true + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": "2m", + "yAxis": { + "decimals": null, + "format": "dBm", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": 2 + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 65 + }, + "id": 16, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideZero": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/Ch0/", + "color": "#7EB26D" + }, + { + "alias": "/Ch1/", + "color": "#1F78C1" + }, + { + "alias": "/Ch2/", + "color": "#CCA300" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "item": { + "filter": "/Rx signal strength for Ch/" + }, + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Rx signal strength over channels", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "dBm", + "label": null, + "logBase": 1, + "max": "0", + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 65 + }, + "id": 17, + "interval": "", + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "show": false, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "Wireless" + }, + "expr": "mtxrWlRtabSignalToNoise{instance=\"$node\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "Network" + }, + "host": { + "filter": "MikroTik Router" + }, + "intervalFactor": 1, + "item": { + "filter": "/Signal to noise/" + }, + "legendFormat": "{{mtxrWlRtabAddr}}", + "mode": 0, + "options": { + "showDisabledItems": false + }, + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "lt", + "value": 25, + "yaxis": "left" + }, + { + "colorMode": "warning", + "fill": true, + "line": true, + "op": "lt", + "value": 35, + "yaxis": "left" + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Signal to noise", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "dB", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "repeat": null, + "title": "Wireless Signal", + "type": "row" + } + ], + "refresh": "10s", + "schemaVersion": 22, + "style": "dark", + "tags": [ + "dashboard", + "mikrotik" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "text": "675305c5f773.sn.mynetname.net", + "value": "675305c5f773.sn.mynetname.net" + }, + "datasource": "Prometheus", + "definition": "label_values(mikrotik_system_uptime,address)", + "hide": 0, + "includeAll": false, + "index": -1, + "label": "node", + "multi": false, + "name": "node", + "options": [], + "query": "label_values(mikrotik_system_uptime,address)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Mikrotik Exporter", + "uid": "000000168", + "variables": { + "list": [] + }, + "version": 1 + } \ No newline at end of file diff --git a/grafana/provisioning/datasources/datasource.yml b/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 0000000..6d977d3 --- /dev/null +++ b/grafana/provisioning/datasources/datasource.yml @@ -0,0 +1,12 @@ + +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + basicAuth: false + isDefault: true + editable: true diff --git a/mikrotik_exporter/config.yml b/mikrotik_exporter/config.yml index f2b46a2..63873c7 100644 --- a/mikrotik_exporter/config.yml +++ b/mikrotik_exporter/config.yml @@ -2,5 +2,23 @@ devices: - name: Chateau address: 192.168.0.1 user: prometheus - password: TOP_SECRET - \ No newline at end of file + password: FOOO + +features: + bgp: false + dhcp: true + dhcpv6: true + dhcpl: true + routes: true + firmware: true + pools: true + monitor: true + health: true + resource: true + interface: true + health: true + pool: true + wlansta: true + wlanif: true + lte: false + netwatch: true