powercom
is a driver for the PowerCom UPS. It serves as a
communication channel between the UPS attached on
<device>
and the upsd daemon. The driver's task is to pass upsd process information
about UPS state and parameters. The driver can also send the UPS instant
commands.
Alternatively it can instruct the UPS to shutoff the load
in a timely fashion when instructed to on the command line.
powercom
has two modes of operation which are determined by the command line switches.
In the first mode, which is what will be activated almost all the time,
powercom
will periodically inquire the UPS for its state and parameters and have the
results of this inquiries avaiable to upsd and there after for the various
clients. In this mode of operation it will also have instant commands sent by
upsd transferred to the UPS. This mode is operational whenever the
-k
switch has not been given on the command line.
In its second mode of operation,
powercom
will instructs the UPS to cut of the power, possibly after some delay. This
mode of operation is intended for cases when it is known that the UPS is on
battery and the mains electricity supply will not be back in a short while and
therefore the machine has to be turned off.
OPTIONS
-h
display an help message without doing anything else. This option is the only
one for which the
<device>
parameter is ignored and can be omitted. This option overides any other option.
-d <num>
this optional flag might be used only when the UPS is instructed to cut off
the power. It is meant to have
powercom
wait additional
<num>
seconds before announcing that driver failed command the UPS to turn
off the power to the load.
-k
instructs
powercom
to order the UPS which is attached to
<device>
to cut off the power.
-i <str>
gives the UPS that is attached to
<device>
the identification of the string
<str>.
The default value for it is "myups".
-l <num>
indicates which is the mains electricity voltage that is fed to the UPS which
it is connected to.
<device>.
Consequently, this voltage should be regarded as on line. The default value is
230 volts.
-m <str>
A string that represents the model of the UPS that is attached to
<device>.
The default name is "Unknown".
-s <str>
A string that represents the serial number of the UPS that is attached to
<device>.
The default string is "Unknown".
DIAGNOSTICS
In addition to recording activities such as first activation, instant commands
and cutting the power in the system logs and the console there are clients for
inspecting the state and parameters values of the UPS as well as clients for
sending the UPS instant commands.
FILES
In normal operation
powercom
will be called only from the system init scripts. These might be
/etc/init.d/nut
and
/etc/init.d/halt.
In this way of using it the configuration files
upsd.conf
and
upsmon.conf
controls its operation. These files might be in
/etc/nut.
Please note that all paths are system dependant.
BUGS
Some of the conversions of binary data that is reported by the UPS into
numerical values, notably the battery precentage, are wrong. Yet the UPS also
reports when its battery is low, which is why the bad conversion of the
battery precentage does not harm the functionality of the model driver.
The -d switch is ignored when not being given with conjunction with the -k
switch.
There is no verification or otherwise cross matching between the -i name and
the corresponding name in the configuration files.