Apcupsd's Support for SNMP UPSes
General
Apcupsd version 3.10.0 or later provides direct support for SNMP UPSes.
To run apcupsd with an SNMP UPS, you need the following
things:
- An SNMP UPS, for example a Web/SNMP card installed into the SmartSlot.
- Apcupsd version 3.10.0 or higher
- Net-SNMP
library (previously known as ucd-snmp) installed
Connecting an SNMP UPS
The Simple Network Management Protocol provides an interface
to connect to remote devices through the network.
apcupsd is now capable of using the SNMP interface of
an SNMP-enabled UPS to communicate with an UPS.
Currently apcupsd supports only APC's PowerNet MIB.
To enable the SNMP support it is enough to configure the correct
device in your apcupsd.conf configuration file.
The directive needed for this configuration is:
DEVICE 192.168.100.2:161:APC:private
where the directive is made by four parts:
- IP address of the remote UPS
- Remote SNMP port
- Kind of remote SNMP agent, currently can only be "APC" for APC's
powernet MIB
- The read-write community string, usually it is "private"
for read-write access.
Building and Installing apcupsd
Follow the instructions in the Installation Chapter
of this manual, being sure to include the following options (in addition
to any others you need) on the ./configure line:
./configure \
--with-serial-dev= \
--with-upstype=snmp \
--with-upscable=smart \
--enable-pthreads \
--enable-snmp
SNMP Specific Information
The SNMP connection gives less information compared to a serial
smart cable. This is not a problem as the most useful information
is given, together with a number of secondary parameters that are
informative enough to run safely your UPS.
Known Problems
Power Off (killpower) of SNMP UPS needs special handling
Currently (as of 3.10.0) the code to power off the UPS needs special
configuration. The killpower command for SNMP UPSes can not be
issued during shutdown as typically at some time during shutdown
operations the network stack is stopped. To overcome this problem
it is needed to modify the /etc/rc.d/apcupsd system control script to
tell apcupsd to issue the power down command (killpower) to the
UPS immediately before apcupsd initiates the system shutdown. For this
reason it is paramount to set your UPS grace time to a value greater
than 120 seconds to allow for clean shutdown operations before the
UPS removes the power from its plugs.
To enable correct shutdown operation during powerdown do the following:
- Connect to your Web/SNMP card using your favorite web browser, go
to the UPS configuration menu and change the "Shutdown Delay" parameter
to 180 seconds or more, depending on how much time your system shutdown
requires to umount all the filesystems.
- Change /etc/rc.d/apcupsd script adding the '--kill-on-powerfail'
to the apcupsd invocation.
- Restart your apcupsd
With this setup your UPS operations should be safe.