HON95 / prometheus-nut-exporter

A Prometheus exporter for Network UPS Tools (NUT)
GNU General Public License v3.0
93 stars 17 forks source link

Add option to calculate a UPS power value when none available - "UPS_POWER_FROM_LOAD_PERCENTAGE" #37

Open seb26 opened 1 month ago

seb26 commented 1 month ago

This works on my setup with a CyberPower OR600ERM1U UPS.

I'd love to run tests and poked around in manage/ but I couldn't figure out how to get that going - if you have any pointers I'd be happy to try again

My upsc output pretty much matches the CyberPower example in example-data/LIST-VAR-4.txt.

seb26 commented 1 month ago

This error fails on HEAD anyway:

error: use of `or_insert_with` to construct default value
   --> src/metrics.rs:531:39

This one is unique to my code in this PR:

error: this `if` statement can be collapsed
   --> src/nut_client.rs:136:5

I will try to address this.

HON95 commented 1 month ago

Sorry for the slow response on this, I haven't forgotten it. And thanks for the contribution.