librenms/librenms-agent

apcUPSd values mixed up

oernii opened this issue · 2 comments

I have succesfuly installed https://github.com/librenms/librenms-agent/blob/master/snmp/ups-apcups on my servers. The values reported in the JSON are correct.

The web interface however mixes these values up, it shows 13 for charge (should be time_remaining, shows 57,2 for charge (should be load) and shows 100 for battery_voltage (should be charge).

JSON:
{"version":1,"error":"0","data":{"time_remaining":"13.0","battery_nominal":"48.0","charge":"100.0","nominal_voltage":null,"input_voltage":"223.2","battery_voltage":"55.1","load":"57.2"},"errorString":"apcaccess exited with 0"}

Screenshot: https://images2.imgbox.com/98/ef/zlGLfywJ_o.png

Howdy!

Been looking at this here as well and am seeing the same thing.

Tracked this down to an issue in the poller. I went ahead and wired these down and included a bit of extra checking as I found it could occasionally return a odd value in some situations.

librenms/librenms#10375 <--- fixes it