Difference between revisions of "UPS setup"

From Amahi Wiki
Jump to: navigation, search
Line 7: Line 7:
 
First, do this:
 
First, do this:
 
{{Code|Code=
 
{{Code|Code=
# yum -y install nut nut-client
+
yum -y install nut nut-client
 
}}
 
}}
 
Next, you will need to configure three files in /etc/ups: ups.conf, upsd.users, and upsmon.conf. They will look almost identical to Selinger's:
 
Next, you will need to configure three files in /etc/ups: ups.conf, upsd.users, and upsmon.conf. They will look almost identical to Selinger's:
 
{{Code|Code=
 
{{Code|Code=
/usr/etc/ups.conf:
+
vi /usr/etc/ups.conf}}
----------------------------------------------------------------------
+
{{Text|Text=
 
[apc]
 
[apc]
 
         driver = usbhid-ups
 
         driver = usbhid-ups
 
         port = auto
 
         port = auto
         desc = "APC Back-UPS ES 550"
+
         desc = "APC Back-UPS ES 550"}}
 
+
{{Code|Code=
/usr/etc/upsd.users:
+
vi /usr/etc/upsd.users
----------------------------------------------------------------------
+
}}
 +
{{Text|Text=
 
[admin]
 
[admin]
 
         password = password1
 
         password = password1
Line 27: Line 28:
 
         password = password2
 
         password = password2
 
         upsmon master
 
         upsmon master
 
+
}}
/usr/etc/upsmon.conf:
+
{{Code|Code=
----------------------------------------------------------------------
+
vi /usr/etc/upsmon.conf}}
 +
{{Text|Text=
 
MONITOR apc@localhost 1 monuser password2 master
 
MONITOR apc@localhost 1 monuser password2 master
 
MINSUPPLIES 1
 
MINSUPPLIES 1
Line 44: Line 46:
 
The next step is to start the UPS service:
 
The next step is to start the UPS service:
 
{{Code|
 
{{Code|
# upsdrvctl start
+
upsdrvctl start
# service ups stop
+
service ups stop
# service ups start
+
service ups start
 
}}
 
}}
 
At this point, you should see something like this in your terminal:
 
At this point, you should see something like this in your terminal:
{{Code|
+
Starting UPS driver controller:                            [  OK  ]
Starting UPS driver controller:                            [  OK  ]
+
Starting upsd:                                            [  OK  ]
Starting upsd:                                            [  OK  ]
+
Starting UPS monitor (master):                            [  OK  ]
Starting UPS monitor (master):                            [  OK  ]
+
 
}}
 
 
If you do not, it may be because upsdrvctl refuses to cooperate at first. A reboot will fix that problem. The final step is to make sure that the UPS services start when the server does. For that, the /etc/rc.local file must be edited as follows:
 
If you do not, it may be because upsdrvctl refuses to cooperate at first. A reboot will fix that problem. The final step is to make sure that the UPS services start when the server does. For that, the /etc/rc.local file must be edited as follows:
 +
 +
echo "Starting UPS driver, daemon, and monitor."
 
{{Code|
 
{{Code|
echo "Starting UPS driver, daemon, and monitor."
 
 
/sbin/upsdrvctl start
 
/sbin/upsdrvctl start
 
/usr/sbin/upsd
 
/usr/sbin/upsd
 
/usr/sbin/upsmon
 
/usr/sbin/upsmon
 
}}
 
}}

Revision as of 21:11, 10 February 2011

Powering Amahi (Fedora 12, Intel Atom D510MO) with APC Back-UPS ES 550 and NUT

The APC Back-UPS ES 550 is a consumer-grade UPS: the software it comes with does not work in Linux. Instead, you need to use NUT or apcupsd. Google will turn up evidence that both work.

The original NUT instructions that this article 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.

First, do this:

bash code
​yum -y install nut nut-client​

Next, you will need to configure three files in /etc/ups: ups.conf, upsd.users, and upsmon.conf. They will look almost identical to Selinger's:

bash code
​vi /usr/etc/ups.conf​
Text
​[apc] driver = usbhid-ups port = auto desc = "APC Back-UPS ES 550"​
bash code
​vi /usr/etc/upsd.users​
Text
​[admin] password = password1 actions = SET instcmds = ALL [monuser] password = password2 upsmon master​
bash code
​vi /usr/etc/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​

The next step is to start the UPS service:

bash code
​ upsdrvctl start service ups stop service ups start ​

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

Starting UPS driver controller:                            [  OK  ]
Starting upsd:                                             [  OK  ]
Starting UPS monitor (master):                             [  OK  ]

If you do not, it may be because upsdrvctl refuses to cooperate at first. A reboot will fix that problem. The final step is to make sure that the UPS services start when the server does. For that, the /etc/rc.local file must be edited as follows:

echo "Starting UPS driver, daemon, and monitor."
bash code
​ /sbin/upsdrvctl start /usr/sbin/upsd /usr/sbin/upsmon ​