This is an old revision of the document!
Network UPS Tools
Network UPS Tools (NUT) is a very cool project that is capable to manage your computers connected to UPS batteries.
For a proper setup follow the great Gentoo WIKI page on NUT.
Installation
It's pretty simple:
emerge --ask sys-power/nut
To detect your UPS devices, assuming it is connected locally or over the network:
/usr/bin/nut-scanner
the output from this command will go into the /etc/nut/ups.conf file.
If your UPS is USB, you need also the following:
usermod -a -G usb nut
Configuration
You need to populate the following files:
- nut.conf
MODE=netserver
Here you put the output of the scan command above:
- ups.conf
[nutdev1] driver = "usbhid-ups" port = "auto" vendorid = "0463" productid = "FFFF" product = "Eaton 3S" serial = "Blank" vendor = "EATON" bus = "001"
- upsd.conf
LISTEN 127.0.0.1 3493 LISTEN 10.0.0.1 3493 </flie> <file - upsd.users> [monmaster] password = monmaster upsmon master [monslave] password = monslave upsmon slave
- upsmon.conf
MONITOR nutdev1@127.0.0.1 1 monmaster monmaster master
- upssched.conf
AT ONBATT * START-TIMER onbatt 300 AT ONLINE * CANCEL-TIMER onbatt online AT LOWBATT * EXECUTE onbatt AT COMMBAD * START-TIMER commbad 30 AT COMMOK * CANCEL-TIMER commbad commok AT NOCOMM * EXECUTE commbad AT SHUTDOWN * EXECUTE powerdown AT REPLBATT * EXECUTE replacebatt
Autostart
Add the following services:
rc-update add upsdrv default
rc-update add upsd default
rc-update add upsmon default
# start now:
rc-service upsdrv start
rc-service upsd start
rc-service upsmon start