As of writing this, the version of NUT in EPEL is: 2.2.0
The latest version available from the NUT website is: 2.4.1
NUT Server Configuration with APC Smart-UPS RT 2000VA UPS
- You will first need to enable the EPEL yum repository.
- Install nut.x86_64 and nut-client.x86_64
- Create the USB device. You will need info from dmesg.
[root@einstein-test ~]# mknod /dev/hiddev0 c 180 96
- Change ownership of the USB device.
[root@einstein-test ~]# chown nut /dev/hiddev0
- Add the following text to /etc/ups/ups.conf
[apc1]
driver = usbhid-ups
port = /dev/hiddev0
desc = "APC UPS"
- Add the following text to /etc/ups/upsd.conf
#ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACL e_boxen 129.89.61.0/255.255.255.0
ACCEPT localhost
ACCEPT e_boxen
REJECT all
- Add the following text to /etc/ups/upsd.users
[admin]
password = adminpwd
allowfrom = localhost
actions = SET
instcmds = ALL
[client]
password = clientpwd
allowfrom = localhost e_boxen
upsmon master
- Add the following text to the MONITOR line of /etc/ups/upsmon.conf
MONITOR apc1@einstein-test.phys.uwm.edu 1 client clientpwd master
- Start the UPS service
- Check the UPS communication by the following command
[root@einstein-test ~]# upsc apc1@einstein-test
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2009/05/19
battery.runtime: 1980
battery.runtime.low: 120
battery.temperature: 24
battery.type: PbAc
battery.voltage: 54.5
battery.voltage.nominal: 48.0
driver.name: usbhid-ups
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/hiddev0
driver.version: 2.2.0-
driver.version.data: APC/CyberPower HID 0.9
driver.version.internal: 0.30
input.transfer.high: 133
input.transfer.low: 86
input.voltage: 117.3
output.voltage: 120.2
output.voltage.nominal: 120.0
ups.beeper.status: enabled
ups.delay.restart: -1
ups.delay.shutdown: -1
ups.firmware: 801.4.D
ups.firmware.aux: 6.2
ups.load: 30.0
ups.mfr: American Power Conversion
ups.mfr.date: 2009/05/19
ups.model: Smart-UPS RT 2000 XL
ups.productid: 0002
ups.serial: JS0921001395
ups.status: OL
ups.test.result: No test initiated
ups.vendorid: 051d
- You will then want to make sure the UPS service is turned on
[root@einstein-test ~]# chkconfig ups on
NUT CGI Configuration
To get information regarding the UPS via a web page I did the following:
- If httpd is not installed, do that first.
- Install the nut-cgi package.
[root@einstein-test cgi-bin]# yum install nut-cgi.x86_64
- Add ups information to /etc/ups/hosts.conf
MONITOR apc1@einstein-test.phys.uwm.edu "Einstein UPS"
MONITOR powerware@nemo.phys.uwm.edu "NEMO UPS"
- The nut cgi scripts are found at /var/www/nut-cgi-bin/ which I moved to /var/www/cgi-bin/
- I only did this to avoid configuring apache. This will be cleaned up in the future.
- Start apache if it is not already running
- Start NUTs if it is not already running
- In a web browser, go to http://einstein-test.phys.uwm.edu/cgi-bin/upsstats.cgi
NUT Client Configuration
To Setup a NUT Client on a Centos 5 Install.
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'
- Install Nut Client package
yum install nut-client.x86_64
- Edit /etc/ups/upsmon.conf
'MONITOR powerware@m0001 1 client clientpass master'
- add the following to NOTIFYMSG section:
NOTIFYMSG ONLINE "UPS %s is getting line power"
NOTIFYMSG ONBATT "UPS %s is on battery"
NOTIFYMSG LOWBATT "UPS %s low battery warning"
NOTIFYMSG COMMOK "Communications established with %s UPS"
NOTIFYMSG COMMBAD "Communications lost from UPS %s"
NOTIFYMSG SHUTDOWN "System is being shutdown by UPS %s"
NOTIFYMSG REPLBATT "The UPS battery is bad and needs to be replaced"
NOTIFYMSG NOCOMM "UPS %s is unavailable (can't be contacted for monitoring)"
- then add the following to the NOTIFYFLAG section:
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG COMMOK SYSLOG+EXEC
NOTIFYFLAG COMMBAD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
NOTIFYFLAG REPLBATT SYSLOG+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
- next chkconfig ups on
- and then /etc/init.d/ups start
- you can double check by running
upsc powerware@nemo.phys.uwm.edu
--
AdamMiller - 15 Feb 2010