As we implemented the MikroTik Plugin from Exchange made by @ttr we ran in to some Problems with the checks for powerconsumption.
We did get these crash reports:
As we implemented the MikroTik Plugin from Exchange made by @ttr we ran in to some Problems with the checks for powerconsumption.
We did get these crash reports:
After a bit of changing the Code in the mikrotik_power.py we did get that fixed for the CRS328 Switches.
But we did ran in to another Problem with the RB960PGS and RB760iGS.
So another bit of Coding in the mikrotik_power.py to fix the data we receive from the switches.
We did make these Changes in the “mikrotik_power.py”:
# calc power-consumption if missing
powerConsumption = 0
for psu in data:
if 'power-consumption' not in psu:
try:
powerConsumption += data[psu]['current'] * data[psu]['voltage'] / 1000
except:
powerConsumption = 0
data['power-consumption'] = powerConsumption
# power
if section['power-consumption'] == 0:
mysummary.append('Voltage: %s V' % round(section['voltage'],2))
else:
mysummary.append('Power: %s W' % round(section['power-consumption']))
So now we do get two different Summarys:
Maybe @ttr wants to add this or something similar in the next Version, that more of the different Mikrotik switches are covered with the Plugin without getting Crash Reports.
If you Tom has any questions, feel free to text me.
PS: Sorry for 3 Texts, but as “new Member” i can only put one Mediafile in each Message^^
Hi,
Thanks for pointing this out, a bug indeed. Mikrotik API responses are sometimes kinda gambling. I will fix this in future releases and will make it more robust.
Regards,
ttr