Closed lahwaacz closed 2 years ago
I initially made an issue with this same request, so I will bump this issue instead and leave what I wrote on my issue:
This would be extremely useful to know when a device switches to using the battery. I think something like this other exporter could be merged into this exporter: https://github.com/damomurf/apcupsd-exporter
The apcaccess
command outputs STATUS
, with values such as:
I'm proposing adding this as a label in apcupsd_info
so that it would look something like:
apcupsd_info{status="ONLINE", hostname="xxx", instance="xxx", job="xxx", model="xxx", ups="UnitedScaffold-SBC1"}
Using such a label would allows us to create alerts such as:
- alert: UPSSwitchedToBattery
expr: apcupsd_info{status="ONBATT"} == 1
PR #8 would have implemented a similar change but it was closed for some reason.
Fixed in https://github.com/mdlayher/apcupsd_exporter/commit/3f531e59fc85ebd86ce9806a1336818c5db18bcb.
Apologies for the delay. The previous PR had a lot of churn and I ended up doing a lot of cleanup myself but let this one slip.
Is it possible to monitor the UPS status? For example,
apcaccess
reports the STATUS field:Having metrics for this would be useful e.g. for alerts on REPLACEBATT, OVERLOAD, etc.