Difference between revisions of "UPS setup"

From Amahi Wiki
Jump to: navigation, search
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Powering Amahi (Fedora 12, Intel Atom D510MO) with APC Back-UPS ES 550 and [http://www.networkupstools.org/index.html NUT] ==
+
{{NeedsUpdate}}
  
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 [http://www.mscs.dal.ca/~selinger/ups/backups.html here] and [http://billauer.co.il/blog/2010/01/fedora-mustek-powermust-600-ups-nut-howto/ 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.
+
== Powering Amahi (Fedora 12/14) with APC Back-UPS and [http://www.networkupstools.org/index.html Network UPS Tools (NUT)] ==
  
First, do this:
+
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.
{{Code|Code=
+
 
# yum -y install nut nut-client
+
The original instructions that this guidance is based on came from [http://www.mscs.dal.ca/~selinger/ups/backups.html here] and [http://billauer.co.il/blog/2010/01/fedora-mustek-powermust-600-ups-nut-howto/ 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.
}}
+
 
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=
+
'''NOTE:'''  This will be a future Amahi Web Application.  To use the web monitoring capability, see [http://www.amahi.org/apps/ups-monitor UPS Monitor].
/usr/etc/ups.conf:
+
 
----------------------------------------------------------------------
+
 
 +
First, do this as [http://wiki.amahi.org/index.php/Open_Terminal_as_root root user]:
 +
 
 +
yum -y install nut nut-client
 +
 
 +
Next, you will need to configure four files in /etc/ups: 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):
 +
 
 +
vi /etc/ups/ups.conf
 +
 
 +
<pre>
 
[apc]
 
[apc]
 
         driver = usbhid-ups
 
         driver = usbhid-ups
 
         port = auto
 
         port = auto
         desc = "APC Back-UPS ES 550"
+
         desc = "APC Back-UPS"
 +
</pre>
 +
 
 +
vi /etc/ups/upsd.users
  
/usr/etc/upsd.users:
+
<pre>
----------------------------------------------------------------------
 
 
[admin]
 
[admin]
 
         password = password1
 
         password = password1
Line 27: Line 37:
 
         password = password2
 
         password = password2
 
         upsmon master
 
         upsmon master
 +
</pre>
 +
 +
vi /etc/ups/hosts.conf
  
/usr/etc/upsmon.conf:
+
<pre>
----------------------------------------------------------------------
+
MONITOR apc@localhost "UPS on HDA"
 +
</pre>
 +
 
 +
vi /etc/ups/upsmon.conf
 +
 
 +
<pre>
 
MONITOR apc@localhost 1 monuser password2 master
 
MONITOR apc@localhost 1 monuser password2 master
 
MINSUPPLIES 1
 
MINSUPPLIES 1
Line 41: Line 59:
 
NOCOMMWARNTIME 300
 
NOCOMMWARNTIME 300
 
FINALDELAY 5
 
FINALDELAY 5
}}
+
</pre>
 +
 
 +
 
 
The next step is to start the UPS service:
 
The next step is to start the UPS service:
{{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:
{{Code|
+
 
 +
vi /etc/rc.local
 +
 
 +
<pre>
 
echo "Starting UPS driver, daemon, and monitor."
 
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
}}
+
</pre>

Latest revision as of 03:46, 23 June 2020

Msgbox.update.png Update Needed
The contents of this page have become outdated or irrelevant. Please consider updating it.


Powering Amahi (Fedora 12/14) 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.

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: This will be a future Amahi Web Application. To use the web monitoring capability, see UPS Monitor.


First, do this as root user:

yum -y install nut nut-client

Next, you will need to configure four files in /etc/ups: 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):

vi /etc/ups/ups.conf
[apc]
        driver = usbhid-ups
        port = auto
        desc = "APC Back-UPS"

vi /etc/ups/upsd.users

[admin]
        password = password1
        actions = SET
        instcmds = ALL
[monuser]
        password = password2
        upsmon master
vi /etc/ups/hosts.conf
MONITOR apc@localhost "UPS on HDA"
vi /etc/ups/upsmon.conf
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:

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:

vi /etc/rc.local
echo "Starting UPS driver, daemon, and monitor."
/sbin/upsdrvctl start
/usr/sbin/upsd
/usr/sbin/upsmon