Difference between revisions of "UPS Ubuntu Setup"

From Amahi Wiki
Jump to: navigation, search
Line 11: Line 11:
 
First, do this as [[Open_Terminal_as_root|root user]]:
 
First, do this as [[Open_Terminal_as_root|root user]]:
 
{{Code|Code=
 
{{Code|Code=
sudo apt-get -y install nut nut-client
+
sudo apt-get -y install nut nut-client nut-cgi
 
}}
 
}}
  

Revision as of 01:15, 7 May 2013

Powering Amahi (Ubuntu 12.04) with APC Back-UPS and Network UPS Tools (NUT)

The software APC Back-UPS comes with does not work in Linux. Instead, you need to use NUT or apcupsd. Google will turn up evidence that both work, but NUT seems to be the preferred one.

Adapted from the original instructions that this guidance is based on came from here and here. The former, by Peter Selinger, are closest to this case, but a lot of the work he had to do is now done for you out of the box. The latter are for a different UPS, but are also fresher.


NOTE: The Amahi Web Application UPS Monitor provides web monitoring capability..


First, do this as root user:

bash code
​sudo apt-get -y install nut nut-client nut-cgi​


Next, you will need to configure four files in /etc/nut: nut.conf, ups.conf, upsd.users, hosts.conf, and upsmon.conf. They will look almost identical to Selinger's (password1 and password2 can be changed to anything):

bash code
​sudo vi /etc/nut/ups.conf​


Text
​[apc] driver = usbhid-ups port = auto desc = "APC Back-UPS"​


bash code
​sudo vi /etc/nut/upsd.users​


Text
​[admin] password = password1 actions = SET instcmds = ALL [monuser] password = password2 upsmon master​


bash code
​sudo vi /etc/nut/hosts.conf​


Text
​MONITOR apc@localhost "UPS on HDA"​

NOTE: If using UPS Monitor, skip the hosts.conf portion or you will end up with double entries.

bash code
​sudo vi /etc/nut/upsmon.conf​


Text
​MONITOR apc@localhost 1 monuser password2 master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5​
bash code
​sudo vi /etc/nut/nut.conf​


Text
​MODE=standalone​

The next step is to start the UPS service:

bash code
​ sudo service ups-monitor stop sudo service ups-monitor start ​


At this point, you should see something like this in your terminal:

Starting UPS monitor (master):                             [  OK  ]

If you do not, it may be because upsdrvctl refuses to cooperate at first. A reboot should fix that problem.