« Guys, gals... let's call a truce in the toilet seat wars | Seriously... WTF... Seriously » |
UPS monitoring for Linux via Python: ups_control
hacks, open source, educationIf you, like me, run a Linux box on a UPS and have to use the largely featureless genericups
driver that ships with NUT, have no fear... Python is here.
Guillaume Savary has written a pretty sophisticated python application, ups_control, that monitors your UPS and then emails you when it has an on-battery or low-battery event. In the latter case or when it's been on battery for too long, it also shuts your system down after sending you a friendly email.
Note: on our FC4 system, we had to change gprintf
in the ups_control
file to printf
before it would work. I guess I should write a patch that handles that, right? Sure thing... (this is a patch to the ups_control Makefile
):
http://www.josephhall.org/patches/ups_control-gprintf.1.7.1.patch.txt
A quick
patch < ups_control-gprintf.1.7.1.patch.txt
in the unpacked ups_control
directory should do it (do this before you run make install
).