10
0

More ROS 7.x fixes
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Lauri Võsandi 2022-08-17 20:43:05 +03:00
parent 427d88f842
commit 22e623a992

View File

@ -42,7 +42,7 @@ async def wrap(i):
async def scrape_mikrotik(mk): async def scrape_mikrotik(mk):
async for obj in mk.query("/interface/print"): async for obj in mk.query("/interface/print"):
labels = {"port": obj["name"], "type": obj["type"]} labels = {"port": obj["name"], "type": obj.get("type", "null")}
yield "interface_rx_bytes", "counter", obj["rx-byte"], labels yield "interface_rx_bytes", "counter", obj["rx-byte"], labels
yield "interface_tx_bytes", "counter", obj["tx-byte"], labels yield "interface_tx_bytes", "counter", obj["tx-byte"], labels
yield "interface_rx_packets", "counter", obj["rx-packet"], labels yield "interface_rx_packets", "counter", obj["rx-packet"], labels
@ -162,6 +162,8 @@ async def scrape_mikrotik(mk):
elif key == "state" or key == "state-after-reboot": elif key == "state" or key == "state-after-reboot":
# Seems disabled on x86 # Seems disabled on x86
pass pass
elif key == "poe-out-consumption":
pass
else: else:
raise NotImplementedError("Don't know how to handle system health record %s" % repr(key)) raise NotImplementedError("Don't know how to handle system health record %s" % repr(key))