Added sensors for total interface tx/rx bytes, fixes #210

This commit is contained in:
Tomaae 2022-06-25 14:34:25 +02:00
parent 574d3137b9
commit 981668032e
No known key found for this signature in database
GPG key ID: 8360BBD8A381D1C0
2 changed files with 44 additions and 0 deletions

View file

@ -700,6 +700,8 @@ class MikrotikControllerData:
{"name": "tx-previous", "default": 0.0},
{"name": "rx", "default": 0.0},
{"name": "tx", "default": 0.0},
{"name": "rx-total", "default": 0.0},
{"name": "tx-total", "default": 0.0},
],
skip=[
{"name": "type", "value": "bridge"},
@ -740,6 +742,9 @@ class MikrotikControllerData:
)
self.data["interface"][uid]["rx-previous"] = current_rx
self.data["interface"][uid]["tx-total"] = current_tx
self.data["interface"][uid]["rx-total"] = current_rx
self.data["interface"] = parse_api(
data=self.data["interface"],
source=self.api.path("/interface/ethernet"),