adds TX/RX packets panels

This commit is contained in:
Leon Morten Richter 2022-07-31 14:29:23 +02:00
parent 2c34649eb7
commit 515b930c38
No known key found for this signature in database
GPG key ID: 9903A6789FCE9468
10 changed files with 359 additions and 174 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
tmp tmp
.idea/ .idea/
mktxp/mktxp.conf

9
Makefile Normal file
View file

@ -0,0 +1,9 @@
.DEFAULT_GOAL := run
clean:
docker-compose down
docker rm -f $(docker ps -a -q)
docker volume rm "$(docker volume ls -q)"
run:
docker-compose up

View file

@ -14,8 +14,9 @@ Over the past years I replaced all my networking gear with Mikrotik devices. I a
## Demo pictures ## Demo pictures
![General system stats](https://github.com/M0r13n/mikrotik_monitoring/blob/main/doc/pic1.png) ![General system stats](https://github.com/M0r13n/mikrotik_monitoring/blob/main/doc/pic_2.png)
![Wifi stats](https://github.com/M0r13n/mikrotik_monitoring/blob/main/doc/pic2.png) ![Firewall stats](https://github.com/M0r13n/mikrotik_monitoring/blob/main/doc/pic_3.png)
![CAPsMAN stats](https://github.com/M0r13n/mikrotik_monitoring/blob/main/doc/pic_5.png)
## Installation ## Installation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

BIN
doc/pic_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

BIN
doc/pic_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
doc/pic_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

BIN
doc/pic_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

View file

@ -16,17 +16,13 @@
"editable": true, "editable": true,
"gnetId": 13679, "gnetId": 13679,
"graphTooltip": 0, "graphTooltip": 0,
"id": 2, "id": 1,
"iteration": 1626361813995, "iteration": 1659266546964,
"links": [], "links": [],
"panels": [ "panels": [
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
@ -921,85 +917,162 @@
"type": "stat" "type": "stat"
}, },
{ {
"aliasColors": {
"In | defconf": "dark-red",
"In | ether2": "dark-blue",
"Incoming traffic on interface ether1-gateway": "#1F78C1",
"Out | defconf": "semi-dark-green",
"Outgoing traffic on interface ether1-gateway": "#EAB839"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "", "description": "",
"editable": true,
"error": false,
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"links": [] "color": {
"mode": "palette-classic"
}, },
"overrides": [] "custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 30,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"links": [],
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bps"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "In | defconf"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-red",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "In | ether2"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Incoming traffic on interface ether1-gateway"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "#1F78C1",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Out | defconf"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "semi-dark-green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Outgoing traffic on interface ether1-gateway"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "#EAB839",
"mode": "fixed"
}
}
]
}
]
}, },
"fill": 3,
"fillGradient": 0,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 9 "y": 9
}, },
"hiddenSeries": false,
"id": 75, "id": 75,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": false,
"hideZero": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": null,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [], "links": [],
"nullPointMode": "connected",
"options": { "options": {
"alertThreshold": false "legend": {
"calcs": [],
"displayMode": "list",
"placement": "right"
}, },
"paceLength": 10, "tooltip": {
"percentage": false, "mode": "single"
"pluginVersion": "8.0.4",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"$$hashKey": "object:842",
"alias": "/In/"
},
{
"$$hashKey": "object:843",
"alias": "/Out/",
"color": "#56A64B",
"transform": "negative-Y"
} }
], },
"spaceLength": 10, "pluginVersion": "8.0.4",
"stack": false,
"steppedLine": false,
"targets": [ "targets": [
{ {
"application": { "application": {
"filter": "Network" "filter": "Network"
}, },
"exemplar": true, "exemplar": true,
"expr": "rate(mktxp_interface_rx_byte_total{routerboard_address=\"$node\"}[15s]) * 8", "expr": " rate(mktxp_interface_rx_byte_total{routerboard_address=\"$node\"}[15s]) * 8 != 0",
"format": "time_series", "format": "time_series",
"functions": [], "functions": [],
"group": { "group": {
@ -1027,7 +1100,7 @@
"filter": "Network" "filter": "Network"
}, },
"exemplar": true, "exemplar": true,
"expr": "rate(mktxp_interface_tx_byte_total{routerboard_address=\"$node\"}[15s]) * 8", "expr": "- rate(mktxp_interface_tx_byte_total{routerboard_address=\"$node\"}[15s]) * 8 != 0",
"format": "time_series", "format": "time_series",
"functions": [], "functions": [],
"group": { "group": {
@ -1050,62 +1123,186 @@
"refId": "B" "refId": "B"
} }
], ],
"thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Interface traffic ", "title": "Interface traffic ",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "left",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 100,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"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": "pps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 16
},
"id": 92,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right"
},
"tooltip": { "tooltip": {
"msResolution": false, "mode": "single"
"shared": true, }
"sort": 2,
"value_type": "individual"
}, },
"type": "graph", "targets": [
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{ {
"$$hashKey": "object:706", "exemplar": true,
"format": "bps", "expr": "rate(mktxp_interface_rx_packet_total{routerboard_address=\"$node\"}[15s]) * 8 != 0",
"label": null, "interval": "",
"logBase": 1, "legendFormat": "{{ name }}",
"max": null, "refId": "A"
"min": null,
"show": true
},
{
"$$hashKey": "object:707",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
} }
], ],
"yaxis": { "title": "Incoming Packets",
"align": false, "type": "timeseries"
"alignLevel": null },
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 100,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"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": "pps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 16
},
"id": 94,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"exemplar": true,
"expr": "rate(mktxp_interface_tx_packet_total{routerboard_address=\"$node\"}[15s]) * 8 != 0",
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Outgoing packets",
"type": "timeseries"
},
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 16 "y": 24
}, },
"id": 2, "id": 2,
"panels": [], "panels": [],
@ -1146,7 +1343,7 @@
"h": 8, "h": 8,
"w": 5, "w": 5,
"x": 0, "x": 0,
"y": 17 "y": 25
}, },
"id": 20, "id": 20,
"interval": null, "interval": null,
@ -1304,7 +1501,7 @@
"h": 11, "h": 11,
"w": 19, "w": 19,
"x": 5, "x": 5,
"y": 17 "y": 25
}, },
"id": 25, "id": 25,
"options": { "options": {
@ -1404,7 +1601,7 @@
"h": 3, "h": 3,
"w": 5, "w": 5,
"x": 0, "x": 0,
"y": 25 "y": 33
}, },
"id": 23, "id": 23,
"interval": null, "interval": null,
@ -1460,15 +1657,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 28 "y": 36
}, },
"id": 45, "id": 45,
"panels": [], "panels": [],
@ -1518,7 +1711,7 @@
"h": 5, "h": 5,
"w": 2, "w": 2,
"x": 0, "x": 0,
"y": 29 "y": 37
}, },
"id": 70, "id": 70,
"options": { "options": {
@ -1576,7 +1769,7 @@
"h": 5, "h": 5,
"w": 4, "w": 4,
"x": 2, "x": 2,
"y": 29 "y": 37
}, },
"id": 71, "id": 71,
"links": [], "links": [],
@ -1671,7 +1864,7 @@
"h": 5, "h": 5,
"w": 6, "w": 6,
"x": 6, "x": 6,
"y": 29 "y": 37
}, },
"id": 69, "id": 69,
"options": { "options": {
@ -1723,7 +1916,7 @@
"h": 16, "h": 16,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 29 "y": 37
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 55, "id": 55,
@ -1879,7 +2072,7 @@
"h": 7, "h": 7,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 34 "y": 42
}, },
"id": 51, "id": 51,
"options": { "options": {
@ -1942,7 +2135,7 @@
"h": 7, "h": 7,
"w": 6, "w": 6,
"x": 6, "x": 6,
"y": 34 "y": 42
}, },
"id": 53, "id": 53,
"options": { "options": {
@ -2093,7 +2286,7 @@
"h": 4, "h": 4,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 41 "y": 49
}, },
"id": 85, "id": 85,
"options": { "options": {
@ -2165,15 +2358,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 45 "y": 53
}, },
"id": 84, "id": 84,
"panels": [], "panels": [],
@ -2205,7 +2394,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 46 "y": 54
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 81, "id": 81,
@ -2338,7 +2527,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 46 "y": 54
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 82, "id": 82,
@ -2471,7 +2660,7 @@
"h": 11, "h": 11,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 53 "y": 61
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 43, "id": 43,
@ -2604,7 +2793,7 @@
"h": 11, "h": 11,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 53 "y": 61
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 76, "id": 76,
@ -2732,7 +2921,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 64 "y": 72
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 27, "id": 27,
@ -2836,7 +3025,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 64 "y": 72
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 74, "id": 74,
@ -2923,15 +3112,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 71 "y": 79
}, },
"id": 90, "id": 90,
"panels": [], "panels": [],
@ -2973,8 +3158,9 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 72 "y": 80
}, },
"hideBranding": false,
"highlightCards": true, "highlightCards": true,
"id": 87, "id": 87,
"legend": { "legend": {
@ -3119,7 +3305,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 72 "y": 80
}, },
"id": 88, "id": 88,
"options": { "options": {
@ -3189,15 +3375,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 80 "y": 88
}, },
"id": 29, "id": 29,
"panels": [], "panels": [],
@ -3222,7 +3404,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 81 "y": 89
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 31, "id": 31,
@ -3324,7 +3506,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 81 "y": 89
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 73, "id": 73,
@ -3501,7 +3683,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 89 "y": 97
}, },
"id": 68, "id": 68,
"options": { "options": {
@ -3582,7 +3764,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 89 "y": 97
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 37, "id": 37,
@ -3685,7 +3867,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 97 "y": 105
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 61, "id": 61,
@ -3794,7 +3976,7 @@
"h": 8, "h": 8,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 97 "y": 105
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 63, "id": 63,
@ -3958,7 +4140,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 105 "y": 113
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 65, "id": 65,
@ -4083,7 +4265,7 @@
"h": 7, "h": 7,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 105 "y": 113
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 66, "id": 66,
@ -4192,15 +4374,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 112 "y": 120
}, },
"id": 33, "id": 33,
"panels": [], "panels": [],
@ -4276,7 +4454,7 @@
"h": 6, "h": 6,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 113 "y": 121
}, },
"id": 35, "id": 35,
"options": { "options": {
@ -4422,7 +4600,7 @@
"h": 15, "h": 15,
"w": 18, "w": 18,
"x": 6, "x": 6,
"y": 113 "y": 121
}, },
"id": 41, "id": 41,
"options": { "options": {
@ -4520,7 +4698,7 @@
"h": 7, "h": 7,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 119 "y": 127
}, },
"id": 47, "id": 47,
"interval": null, "interval": null,
@ -4622,7 +4800,7 @@
"h": 11, "h": 11,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 126 "y": 134
}, },
"id": 48, "id": 48,
"links": [], "links": [],
@ -4693,7 +4871,7 @@
"h": 9, "h": 9,
"w": 18, "w": 18,
"x": 6, "x": 6,
"y": 128 "y": 136
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 49, "id": 49,
@ -4822,7 +5000,7 @@
"h": 10, "h": 10,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 137 "y": 145
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 39, "id": 39,
@ -4969,15 +5147,11 @@
{ {
"collapsed": false, "collapsed": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 147 "y": 155
}, },
"id": 80, "id": 80,
"panels": [], "panels": [],
@ -5022,7 +5196,7 @@
"h": 8, "h": 8,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 148 "y": 156
}, },
"id": 78, "id": 78,
"links": [], "links": [],
@ -5097,7 +5271,7 @@
"h": 8, "h": 8,
"w": 18, "w": 18,
"x": 6, "x": 6,
"y": 148 "y": 156
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 77, "id": 77,
@ -5236,8 +5410,8 @@
"allValue": null, "allValue": null,
"current": { "current": {
"selected": false, "selected": false,
"text": "192.168.0.1", "text": "10.0.10.1",
"value": "192.168.0.1" "value": "10.0.10.1"
}, },
"datasource": "Prometheus", "datasource": "Prometheus",
"definition": "label_values(mktxp_system_identity_info, routerboard_address)", "definition": "label_values(mktxp_system_identity_info, routerboard_address)",
@ -5272,5 +5446,5 @@
"timezone": "", "timezone": "",
"title": "Mikrotik MKTXP Exporter", "title": "Mikrotik MKTXP Exporter",
"uid": "0j4sdLm7z", "uid": "0j4sdLm7z",
"version": 1 "version": 7
} }