The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

upsadm - administrates an UPS using an Hardware::UPS::Perl driver indirectly via TCP or directly on a serial device

SYNOPSIS

upsadmin [ -h, --help ] [ -M, --man ] [ -V, --version ] [ -D, --driver driver ] [ -d, --debug-level [debuglevel] ] [ -r, --remote [HOST:[PORT]] [ -T, --toggle-beeper ] [ -t, --test [period] ] [ -B, --test-battery-low ] [ -c, --cancel-test ] [ -S, --shutdown period ] [ -R, --restore period ] [ -C, --cancel-shutdown ] [device-name]

DESCRIPTION

upsadm is a command line utility to administrate an UPS using a driver specified on the command line. There are to ways of operating:

On the one hand, the UPS can reside on a local serial device specified by the optional device-name parameter. If the parameter is omitted, /dev/ttyS0, i.e. the COM1 port, is used per default unless overriden by the environment variable UPS_DEVICE.

On the other hand, the UPS can be administrated via TCP/IP, if there is an UPS agent running at a remote host speciefied by the --remote option.

OPTIONS

-h, --help

Displays a short usage help message and exits without errors.

-M, --man

Displays the embedded pod documentation of upswatch (this screen) using pod2man, groff and less as pager; it exits without errors.

-V, --version

Displays version information and exits without errors.

-D, --driver driver

Sets the UPS driver driver to use. driver is a case-insensitive string. If not specified, the default driver "Megatec" is used.

-d, --debug-level [debuglevel]

Sets the integer debug level debuglevel. If the debug level is not specified, a default of 1 is assumed. A higher debug level will increase the verbosity. The maximum is 5.

-r, --remote [HOST[:PORT]]

Switches to the remote operation modus, i.e. the UPS is watched via TCP/IP using a remotely running UPS agent. The remote site is specified by the HOST and optionally the TCP port PORT separated by ':'. If not specified, the local host's default FQDN will be used together with default TCP port 9050.

-T, --toggle-beeper

Toggles the beeper.

-t, --test [PERIOD]

Tests the UPS for a period of PERIOD in minutes. If the argument is omitted, a standard test lasting 10 seconds is performed.

-B, --test-battery-low

Tests the UPS until the battery is low.

-c, --cancel-test

Cancels any test activity.

-S, --shutdown [PERIOD]

Causes the UPS to shutdown in a period of PERIOD minutes.

-R, --restores [PERIOD]

Restores the UPS after a period of PERIOD minutes after a shutdown has been performed. This option requires the option --shutdown.

-C, --cancel-shutdown

Cancels any shutdown activity.

EXAMPLES

upsadm

Tests the UPS.

upsadm -t 10 /dev/ttyS1

Tests the UPS on COM2 for 10 minutes.

upsadm -r 192.168.1.2:7030

Tests the UPS located at host 192.168.1.2 via an UPS agent listening at TCP port 7030 at this host.

SEE ALSO

groff(1), less(1), pod2man(1), upsagent(1), upsstat(1), upswatch(1), Getopt::Long(3pm), Hardware::UPS::Perl::Connection(3pm), Hardware::UPS::Perl::Connection::Net(3pm), Hardware::UPS::Perl::Connection::Serial(3pm), Hardware::UPS::Perl::Constants(3pm), Hardware::UPS::Perl::Driver(3pm), Hardware::UPS::Perl::Driver::Megatec(3pm), Hardware::UPS::Perl::General(3pm), Hardware::UPS::Perl::Logging(3pm), Hardware::UPS::Perl::PID(3pm), Hardware::UPS::Perl::Utils(3pm)

AUTHOR

Christian Reile, Christian.Reile@t-online.de