Differences between revisions 1 and 11 (spanning 10 versions)
⇤ ← Revision 1 as of 2015-04-16 17:23:27 →
Size: 1514
Comment:
← Revision 11 as of 2015-04-16 18:07:22 → ⇥
Size: 3168
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= APC UPS Battery-Backed Power Supply Monitor for CentOS == = APC UPS Battery-Backed Power Supply Monitor for CentOS =
The APC Smart-UPS battery-backup devices in the lab support using a daemon, apcupsd, running on CentosOS, which monitors the power-state of the UPS over a USB cable, and if there is a power failure, and the battery is getting close to empty, it will initiate an automatic shutdown. This shutdown won't of course 'save' any open docs you might have, but it will 'cleanly' shutdown the computer, which can prevent the corruption of the hard disk if power to the computer were to otherwise just turn off when the battery drains.
Line 3: Line 4:
The APC Smart-UPS battery-backup devices in the lab support using a daemon, running on CentosOS, which monitors the power-state of the UPS, and if there is a power failure, and the battery is getting close to empty, it will initiate an automatic shutdown. This shutdown won't of course 'save' any open docs you might have, but it will 'cleanly' shutdown the computer, which can prevent the corruption of the hard disk if power to the computer were to otherwise just turn off when the battery drains. The APC Smart-UPS should be connected to your computer by a USB cable for this functionality to work. Do not use the strange serial port ethernet look-alike cable (toss it in the trash, it's useless).
Line 5: Line 6:
To install this, sudo access, or the help of nmrhelp, is needed. These the steps: To install 'apcupsd', sudo access, or the help of nmrhelp, is needed. These are the steps:
Line 10: Line 11:
get source code and build, note that --enable-usb must be included get source code and build, note that --enable-usb '''must''' be included, but that --enable-nis and --enable-gapcmon are optional:
Line 12: Line 13:
./configure --enable-usb {{{
./configure --enable-usb --enable-nis --enable-gapcmon
Line 15: Line 17:

}}}
Line 20: Line 21:
{{{
Line 23: Line 25:
DEVICE
DEVICE
}}}
Line 27: Line 29:
{{{
Line 28: Line 31:
}}}
Line 30: Line 33:
{{{
Line 33: Line 37:
}}}
Line 39: Line 43:
tail the /var/log/messages file and then unplug the power cord from the UPS Open a terminal, then unplug the power cord from the UPS to simulate a power failure. You should see this message on the terminal:

{{{
Broadcast message from root@terrier (Thu Apr 16 17:25:25 2015):

Power failure on UPS TERRIER-APC-UPS. Running on batteries.
}}}
''''' X-( IF YOU SEE THIS MESSAGE, YOU SHOULD IMMEDIATELY SAVE YOUR OPEN DOCS AND SHUTDOWN THE COMPUTER <!> '''''

The battery will only last a couple minutes and the daemon will shutdown the computer without any warning, so it is important to save stuff right away.

If you plug-in the power cord to the UPS, simulating power restoration, you should see:

{{{
Broadcast message from root@terrier (Thu Apr 16 17:24:36 2015):

Power has returned on UPS TERRIER-APC-UPS...
}}}

=== GAPCMON ===
If built with --enable-nis --enable-gapcmon, then 'gapcmon' is a gui application (see http://gapcmon.sourceforge.net/) to get status. Note that you must click 'add' for it to find your UPS to add to the display screen. This same feature could be used to connect to every apcupsd in the lab, if monitoring everyone's power supply was desired.

=== BIOS ===
Independent from this UPS thing, you should also configure the BIOS (press F2 on power-up) to set the Power Options to turn on after a power failure. Otherwise, when power is restored, you'd have to manually press the power-on button on your computer.

APC UPS Battery-Backed Power Supply Monitor for CentOS

The APC Smart-UPS battery-backup devices in the lab support using a daemon, apcupsd, running on CentosOS, which monitors the power-state of the UPS over a USB cable, and if there is a power failure, and the battery is getting close to empty, it will initiate an automatic shutdown. This shutdown won't of course 'save' any open docs you might have, but it will 'cleanly' shutdown the computer, which can prevent the corruption of the hard disk if power to the computer were to otherwise just turn off when the battery drains.

The APC Smart-UPS should be connected to your computer by a USB cable for this functionality to work. Do not use the strange serial port ethernet look-alike cable (toss it in the trash, it's useless).

To install 'apcupsd', sudo access, or the help of nmrhelp, is needed. These are the steps:

BUILD SOURCE

goto: http://www.apcupsd.org/

get source code and build, note that --enable-usb must be included, but that --enable-nis and --enable-gapcmon are optional:

./configure --enable-usb --enable-nis --enable-gapcmon
make
make install

EDIT CONFIG

edit /etc/apcupsd/apcupsd.conf and set the following fields:

UPSCABLE usb

UPSTYPE usb
DEVICE

note that 'DEVICE' is empty. you could also optionally set:

UPSNAME TERRIER-APC-UPS

FIRST-TIME START AND CHECK

sudo /etc/rc.d/init.d/apcupsd start

/sbin/apcaccess

in the output of apcaccess, make sure 'STATUS' is ONLINE, confirming USB connection.

the start command is only necessary after first-time install. or you can just reboot the system, and just run /sbin/apcaccess to confirm that apcupsd is actually running.

TEST

Open a terminal, then unplug the power cord from the UPS to simulate a power failure. You should see this message on the terminal:

Broadcast message from root@terrier (Thu Apr 16 17:25:25 2015):

Power failure on UPS TERRIER-APC-UPS. Running on batteries.

X-( IF YOU SEE THIS MESSAGE, YOU SHOULD IMMEDIATELY SAVE YOUR OPEN DOCS AND SHUTDOWN THE COMPUTER <!>

The battery will only last a couple minutes and the daemon will shutdown the computer without any warning, so it is important to save stuff right away.

If you plug-in the power cord to the UPS, simulating power restoration, you should see:

Broadcast message from root@terrier (Thu Apr 16 17:24:36 2015):

Power has returned on UPS TERRIER-APC-UPS...

GAPCMON

If built with --enable-nis --enable-gapcmon, then 'gapcmon' is a gui application (see http://gapcmon.sourceforge.net/) to get status. Note that you must click 'add' for it to find your UPS to add to the display screen. This same feature could be used to connect to every apcupsd in the lab, if monitoring everyone's power supply was desired.

BIOS

Independent from this UPS thing, you should also configure the BIOS (press F2 on power-up) to set the Power Options to turn on after a power failure. Otherwise, when power is restored, you'd have to manually press the power-on button on your computer.

FreeSurferWiki/APCUPSD (last edited 2021-05-03 08:04:57 by DevaniCordero)