Living in an area with an unreliable power supply I use a Zigor Ebro 650 UPS to keep my Wifi and internet connection up during power cuts. This is a low cost battery backup which can power a Wifi router and ADSL modem for around 5-6 hours. The Buffalo router is running Gargoyle firmware so why not use that to monitor the UPS?
The problem is that the current version of Gargoyle (1.6.1) being based on OpenWrt 12.09 has no NUT package available. Luckily there is a package in the latest OpenWrt snapshot so we can use that.
Firstly we need to obtain the .ipk package files for the router. Mine is ar71xx based so I am using those. The driver for the Ebro 650 is blazer_usb:
cd /tmp wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/nut_2.6.5-2_ar71xx.ipk wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/nut-client_2.6.5-2_ar71xx.ipk wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/nut-server_2.6.5-2_ar71xx.ipk wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/nut-driver-blazer_usb_2.6.5-2_ar71xx.ipk
Extract all the files and install to / using the method I described previously: Manual extraction/installation of .ipk packages on Gargoyle/OpenWrt.
Edit /etc/nut/nut.conf and set MODE:
MODE=netserver if you want to access NUT from other computers.
Edit /etc/nut/upsd.conf and set options:
LISTEN directive if you want network access, otherwise the defaults will probably be good enough.
Edit /etc/config/ups and configure your UPS:
config driver 'ebro' option driver 'blazer_usb' option port 'auto' option protocol 'megatec' option subdriver 'krauler' option vendorid '0001' option productid '0000' option bus '001' option langid_fix '0x409'
This configuration works for my Ebro and may work for other UPSs using the blazer_usb driver (e.g. Tecnoware ERA). You might need to change vendorid and productid (
cat /proc/bus/usb/devices should give you the correct values)
Once configuration is complete it’s time to start the service:
Test with upsc:
This simply displays all the information available from the UPS:
device.model: EBRO 650
Now that we have the data we can do fun things like graphing it. Collectd has a plugin for NUT and I’ve covered that in another post: Simple web based system monitoring on Ubuntu Server.