UPS Monitoring with SUSE. Quick & Dirty
I recently had the need to query a bunch of UPSes to gather their current statistics using openSUSE. The Network UPS Tools packages (NUT for short) are available for openSUSE and that’s all you need (assuming your UPS is one of the supported ones).
# zypper install nut
Next you need to edit /etc/ups/ups.conf and make an entry for your UPS driver and serial port.
[myups]
driver = bcmxcp
port = /dev/ttyUSB0
desc = “Local UPS”
Next I started the UPS driver manually in debug mode so I could see what was going on. The nice thing about this driver is it will auto-discover the UPS serial port speed.
# /usr/lib/ups/driver/bcmxcp -a myups -D
In a separate terminal window, start upsd.
# upsd
Now you should be able to query the UPS:
# upsc myups@localhost
Because I was just collecting statistics, I wasn’t interested in using upsd to automatically shutdown servers or anything fancy but that is possible.