diff --git a/README.md b/README.md index 81984ae..b2e0637 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Over the past years I replaced all my networking gear with Mikrotik devices. I a - [A somewhat useable Grafana Dashboard](https://grafana.com/grafana/dashboards/10950) - [A Prometheus exporter for Mikrotik devices written in Python](https://github.com/akpw/mktxp). - [A Prometheus exporter for Mikrotik devices written in Go](https://github.com/nshttpd/mikrotik-exporter) +- [Smokeping](https://github.com/SuperQ/smokeping_prober) ## Setup @@ -96,6 +97,16 @@ You may need to adjust the following configuration files and add your own creden Done. You should now be able to open the Grafana dashboard on Port 3000 of your Raspberry Pi. +## Latency Monitoring + +This projects uses a [smokeping prober](https://github.com/SuperQ/smokeping_prober) to measure network latency and packet loss. By default three targets are configured: + +- 1.1.1.1 (Cloudflare) +- 8.8.8.8 (Google) +- 9.9.9.9 (IBM) + +You may adjust **smokeping/smokeping.yml** according to your needs. + ## Multiple Nodes It is possible to monitor multiple (Mikrotik) devices. Just change add as many devices to `mktxp/mktxp.conf` as you want. diff --git a/docker-compose.yml b/docker-compose.yml index 8969393..cc8c025 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -70,3 +70,14 @@ services: networks: - default restart: unless-stopped + + # https://github.com/SuperQ/smokeping_prober + smokeping: + image: quay.io/superq/smokeping-prober:latest + container_name: mikrotik-smokeping-prober + command: --config.file=/etc/smokeping/smokeping.yml + volumes: + - ./smokeping/smokeping.yml:/etc/smokeping/smokeping.yml + networks: + - default + restart: unless-stopped diff --git a/grafana/provisioning/dashboards/mikrotik/monitor.json b/grafana/provisioning/dashboards/mikrotik/monitor.json index 7208779..56f1313 100644 --- a/grafana/provisioning/dashboards/mikrotik/monitor.json +++ b/grafana/provisioning/dashboards/mikrotik/monitor.json @@ -112,7 +112,7 @@ "text": {}, "textMode": "name" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "datasource": { @@ -176,7 +176,7 @@ }, "textMode": "name" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "datasource": { @@ -256,7 +256,7 @@ "showUnfilled": true, "text": {} }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "application": { @@ -359,7 +359,7 @@ }, "paceLength": 10, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 5, "points": false, "renderer": "flot", @@ -482,7 +482,7 @@ }, "paceLength": 10, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 5, "points": false, "renderer": "flot", @@ -655,7 +655,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "application": { @@ -749,7 +749,7 @@ "text": {}, "textMode": "name" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "datasource": { @@ -824,7 +824,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "datasource": { @@ -897,7 +897,7 @@ "text": {}, "textMode": "name" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "application": { @@ -982,7 +982,7 @@ "text": {}, "textMode": "value" }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "application": { @@ -1030,6 +1030,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -1088,7 +1090,8 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "right" + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", @@ -1173,6 +1176,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, @@ -1232,7 +1237,8 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "right" + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", @@ -1265,6 +1271,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -1321,7 +1329,8 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "right" + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", @@ -1343,6 +1352,299 @@ "title": "Outgoing packets", "type": "timeseries" }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 131, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 2 + }, + "id": 129, + "options": { + "calculate": false, + "cellGap": 1, + "cellValues": { + "unit": "none" + }, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": false + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "decimals": 0, + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(increase(smokeping_response_duration_seconds_bucket{host=\"8.8.8.8\"}[$__rate_interval])) by (le)", + "format": "heatmap", + "legendFormat": "{{le}}", + "range": true, + "refId": "A" + } + ], + "title": "Latency - ${latency_target}", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "red", + "mode": "fixed", + "seriesBy": "min" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "log": 2, + "type": "log" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 2 + }, + "id": 133, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "(smokeping_requests_total{host=\"${latency_target}\"} - smokeping_response_duration_seconds_count{host=\"${latency_target}\"})/smokeping_requests_total{host=\"${latency_target}\"}", + "legendFormat": "{{host}}", + "range": true, + "refId": "A" + } + ], + "title": "Packet loss (%) - ${latency_target}", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed", + "seriesBy": "max" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 135, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(smokeping_response_duration_seconds_sum{host=\"${latency_target}\"}[$__rate_interval]) / rate(smokeping_response_duration_seconds_count{host=\"${latency_target}\"}[$__rate_interval])", + "instant": false, + "legendFormat": "{{host}}", + "range": true, + "refId": "A" + } + ], + "title": "Latency - ${latency_target}", + "type": "timeseries" + } + ], + "title": "Latency", + "type": "row" + }, { "collapsed": true, "datasource": { @@ -1352,7 +1654,7 @@ "h": 1, "w": 24, "x": 0, - "y": 24 + "y": 25 }, "id": 2, "panels": [ @@ -1371,8 +1673,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "#EAB839", @@ -1391,7 +1692,7 @@ "h": 8, "w": 5, "x": 0, - "y": 25 + "y": 65 }, "id": 20, "links": [], @@ -1466,8 +1767,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1554,7 +1854,7 @@ "h": 11, "w": 19, "x": 5, - "y": 25 + "y": 65 }, "id": 25, "options": { @@ -1642,8 +1942,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "#EAB839", @@ -1662,7 +1961,7 @@ "h": 3, "w": 5, "x": 0, - "y": 33 + "y": 73 }, "id": 23, "links": [], @@ -1738,7 +2037,7 @@ "h": 1, "w": 24, "x": 0, - "y": 25 + "y": 26 }, "id": 45, "panels": [ @@ -1767,8 +2066,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "yellow", @@ -1787,7 +2085,7 @@ "h": 5, "w": 2, "x": 0, - "y": 26 + "y": 66 }, "id": 70, "options": { @@ -1832,8 +2130,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1848,7 +2145,7 @@ "h": 5, "w": 4, "x": 2, - "y": 26 + "y": 66 }, "id": 71, "links": [], @@ -1928,8 +2225,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "yellow", @@ -1948,7 +2244,7 @@ "h": 5, "w": 6, "x": 6, - "y": 26 + "y": 66 }, "id": 69, "options": { @@ -2005,7 +2301,7 @@ "h": 16, "w": 12, "x": 12, - "y": 26 + "y": 66 }, "hiddenSeries": false, "id": 55, @@ -2138,8 +2434,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "yellow", @@ -2158,7 +2453,7 @@ "h": 7, "w": 6, "x": 0, - "y": 31 + "y": 71 }, "id": 51, "options": { @@ -2210,8 +2505,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2227,7 +2521,7 @@ "h": 7, "w": 6, "x": 6, - "y": 31 + "y": 71 }, "id": 53, "options": { @@ -2301,8 +2595,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2389,7 +2682,7 @@ "h": 4, "w": 12, "x": 0, - "y": 38 + "y": 78 }, "id": 85, "options": { @@ -2487,7 +2780,7 @@ "h": 1, "w": 24, "x": 0, - "y": 26 + "y": 27 }, "id": 84, "panels": [ @@ -2518,7 +2811,7 @@ "h": 7, "w": 12, "x": 0, - "y": 54 + "y": 59 }, "hiddenSeries": false, "id": 81, @@ -2544,7 +2837,7 @@ }, "paceLength": 10, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 5, "points": false, "renderer": "flot", @@ -2645,7 +2938,7 @@ "h": 7, "w": 12, "x": 12, - "y": 54 + "y": 59 }, "hiddenSeries": false, "id": 82, @@ -2671,7 +2964,7 @@ }, "paceLength": 10, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 5, "points": false, "renderer": "flot", @@ -2756,6 +3049,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -2789,8 +3084,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2806,7 +3100,7 @@ "h": 15, "w": 12, "x": 0, - "y": 61 + "y": 66 }, "id": 106, "options": { @@ -2818,6 +3112,7 @@ ], "displayMode": "table", "placement": "bottom", + "showLegend": true, "sortBy": "Mean", "sortDesc": true }, @@ -2854,6 +3149,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -2888,8 +3185,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2905,7 +3201,7 @@ "h": 15, "w": 12, "x": 12, - "y": 61 + "y": 66 }, "id": 43, "links": [], @@ -2918,6 +3214,7 @@ ], "displayMode": "table", "placement": "bottom", + "showLegend": true, "sortBy": "Mean", "sortDesc": true }, @@ -2974,6 +3271,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -3008,8 +3307,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3041,7 +3339,7 @@ "h": 6, "w": 24, "x": 0, - "y": 76 + "y": 81 }, "id": 76, "links": [], @@ -3053,7 +3351,8 @@ "min" ], "displayMode": "table", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "multi", @@ -3121,7 +3420,7 @@ "h": 7, "w": 12, "x": 0, - "y": 82 + "y": 87 }, "hiddenSeries": false, "id": 27, @@ -3144,7 +3443,7 @@ "alertThreshold": false }, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -3222,7 +3521,7 @@ "h": 7, "w": 12, "x": 12, - "y": 82 + "y": 87 }, "hiddenSeries": false, "id": 74, @@ -3245,7 +3544,7 @@ "alertThreshold": false }, "percentage": false, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -3298,6 +3597,116 @@ "yaxis": { "align": false } + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Shows active users on all monitored devices.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 94 + }, + "id": 127, + "options": { + "footer": { + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 2, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "routerboard_name" + } + ] + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "mktxp_active_users_info", + "format": "table", + "hide": false, + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "B" + } + ], + "title": "Global Active Users", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "__name__": true, + "instance": true, + "job": true + }, + "indexByName": { + "Time": 9, + "Value": 11, + "__name__": 8, + "address": 2, + "group": 3, + "instance": 7, + "job": 10, + "name": 4, + "routerboard_address": 1, + "routerboard_name": 0, + "via": 5, + "when": 6 + }, + "renameByName": { + "routerboard_address": "", + "routerboard_name": "" + } + } + } + ], + "type": "table" } ], "targets": [ @@ -3320,7 +3729,7 @@ "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 28 }, "id": 90, "panels": [ @@ -3360,7 +3769,7 @@ "h": 8, "w": 12, "x": 0, - "y": 90 + "y": 37 }, "hideBranding": false, "highlightCards": true, @@ -3511,7 +3920,7 @@ "h": 8, "w": 12, "x": 12, - "y": 90 + "y": 37 }, "id": 88, "options": { @@ -3525,7 +3934,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "9.0.6", + "pluginVersion": "9.3.6", "targets": [ { "datasource": { @@ -3607,7 +4016,7 @@ "h": 1, "w": 24, "x": 0, - "y": 28 + "y": 29 }, "id": 29, "panels": [ @@ -3631,7 +4040,7 @@ "h": 8, "w": 12, "x": 0, - "y": 29 + "y": 69 }, "hiddenSeries": false, "id": 31, @@ -3727,7 +4136,7 @@ "h": 8, "w": 12, "x": 12, - "y": 29 + "y": 69 }, "hiddenSeries": false, "id": 73, @@ -3824,8 +4233,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3900,7 +4308,7 @@ "h": 8, "w": 12, "x": 0, - "y": 37 + "y": 77 }, "id": 68, "options": { @@ -3990,7 +4398,7 @@ "h": 8, "w": 12, "x": 12, - "y": 37 + "y": 77 }, "hiddenSeries": false, "id": 37, @@ -4087,7 +4495,7 @@ "h": 8, "w": 12, "x": 0, - "y": 45 + "y": 85 }, "hiddenSeries": false, "id": 61, @@ -4190,7 +4598,7 @@ "h": 8, "w": 12, "x": 12, - "y": 45 + "y": 85 }, "hiddenSeries": false, "id": 63, @@ -4351,7 +4759,7 @@ "h": 7, "w": 12, "x": 0, - "y": 53 + "y": 93 }, "hiddenSeries": false, "id": 65, @@ -4469,7 +4877,7 @@ "h": 7, "w": 12, "x": 12, - "y": 53 + "y": 93 }, "hiddenSeries": false, "id": 66, @@ -4587,7 +4995,7 @@ "h": 1, "w": 24, "x": 0, - "y": 29 + "y": 30 }, "id": 33, "panels": [ @@ -4609,8 +5017,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4663,7 +5070,7 @@ "h": 7, "w": 6, "x": 0, - "y": 30 + "y": 70 }, "id": 35, "options": { @@ -4744,8 +5151,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4820,7 +5226,7 @@ "h": 15, "w": 18, "x": 6, - "y": 30 + "y": 70 }, "id": 41, "options": { @@ -4906,8 +5312,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "#EAB839", @@ -4926,7 +5331,7 @@ "h": 9, "w": 6, "x": 0, - "y": 37 + "y": 77 }, "id": 47, "links": [], @@ -5011,8 +5416,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5027,7 +5431,7 @@ "h": 8, "w": 18, "x": 6, - "y": 45 + "y": 85 }, "id": 104, "options": { @@ -5112,8 +5516,7 @@ "mode": "absolute", "steps": [ { - "color": "red", - "value": null + "color": "red" }, { "color": "orange", @@ -5141,7 +5544,7 @@ "h": 16, "w": 6, "x": 0, - "y": 46 + "y": 86 }, "id": 48, "links": [], @@ -5217,7 +5620,7 @@ "h": 9, "w": 18, "x": 6, - "y": 53 + "y": 93 }, "hiddenSeries": false, "id": 49, @@ -5342,7 +5745,7 @@ "h": 10, "w": 24, "x": 0, - "y": 62 + "y": 102 }, "hiddenSeries": false, "id": 39, @@ -5499,7 +5902,7 @@ "h": 1, "w": 24, "x": 0, - "y": 30 + "y": 31 }, "id": 125, "panels": [ @@ -5596,14 +5999,15 @@ "h": 8, "w": 6, "x": 0, - "y": 143 + "y": 183 }, "id": 108, "options": { "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "single", @@ -5653,7 +6057,7 @@ "h": 1, "w": 24, "x": 0, - "y": 31 + "y": 32 }, "id": 80, "panels": [ @@ -5673,8 +6077,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5689,7 +6092,7 @@ "h": 3, "w": 6, "x": 0, - "y": 32 + "y": 72 }, "id": 102, "options": { @@ -5748,7 +6151,7 @@ "h": 8, "w": 18, "x": 6, - "y": 32 + "y": 72 }, "hiddenSeries": false, "id": 77, @@ -5882,8 +6285,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "yellow", @@ -5907,7 +6309,7 @@ "h": 13, "w": 6, "x": 0, - "y": 35 + "y": 75 }, "id": 78, "links": [], @@ -6006,8 +6408,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] }, @@ -6019,14 +6420,15 @@ "h": 8, "w": 9, "x": 6, - "y": 40 + "y": 80 }, "id": 98, "options": { "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "single", @@ -6105,8 +6507,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "yellow", @@ -6130,14 +6531,15 @@ "h": 8, "w": 9, "x": 15, - "y": 40 + "y": 80 }, "id": 100, "options": { "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "single", @@ -6174,7 +6576,7 @@ } ], "refresh": "10s", - "schemaVersion": 36, + "schemaVersion": 37, "style": "dark", "tags": [ "mikrotik", @@ -6185,7 +6587,7 @@ "list": [ { "current": { - "selected": true, + "selected": false, "text": "10.0.10.1", "value": "10.0.10.1" }, @@ -6242,17 +6644,41 @@ "skipUrlSync": false, "sort": 1, "type": "query" + }, + { + "current": { + "selected": true, + "text": "9.9.9.9", + "value": "9.9.9.9" + }, + "definition": "label_values(smokeping_requests_total, host)", + "description": "Smokepings target to measure the latency", + "hide": 0, + "includeAll": false, + "label": "Latency Target", + "multi": false, + "name": "latency_target", + "options": [], + "query": { + "query": "label_values(smokeping_requests_total, host)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" } ] }, "time": { - "from": "now-15m", + "from": "now-30m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Mikrotik MKTXP Exporter", "uid": "0j4sdLm7z", - "version": 2, + "version": 8, "weekStart": "" } diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index cfd3be3..4749fcb 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -7,7 +7,7 @@ global: # Attach these labels to any time series or alerts when communicating with # external systems (federation, remote storage, Alertmanager). external_labels: - monitor: 'my-project' + monitor: 'mikrotik-monitoring' # Load and evaluate rules in this file every 'evaluation_interval' seconds. rule_files: @@ -31,3 +31,4 @@ scrape_configs: - targets: - 'mikrotik_exporter:9436' - 'mktxp:49090' + - 'smokeping:9374' diff --git a/smokeping/smokeping.yml b/smokeping/smokeping.yml new file mode 100644 index 0000000..e36c4f4 --- /dev/null +++ b/smokeping/smokeping.yml @@ -0,0 +1,10 @@ +--- +targets: +- hosts: + - 1.1.1.1 + - 8.8.8.8 + - 9.9.9.9 + interval: 10s # Duration, Default 1s. + network: ip4 # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6) + protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation) + size: 56 # Packet data size in bytes. Default 56 (Range: 24 - 65535)