APC UPS control system Power Supply User Manual


 
Where host is the name of the host or the IP address of the host running
the Network Information Server. The default is the local host. You may
optionally specify a port address separated from the host name with a colon.
You may also optionally specify a single command to be executed. If you
specify a command, that command will be executed and the client program
will exit. This is a very simple and useful way of pulling the status or
events data into another program such as Perl.
If no error messages are printed, it has most likely established contact with
your server. Anything that you type as standard input will be passed to
the server, and anything the server sends back will be printed to standard
output. There are currently two commands recognized by the server: events
and status. Hence the following commands:
./client
status
events
xyz
^D
should produce the status listing (the same as produced by apcaccess
status), followed by the list of the last 10 events (in response to the events
command), and finally Invalid command in response to the xyz input,
which is not a valid command. The control-D terminates the client pro-
gram.
The purpose of this program is to show you how to write your own program
that can determine the status of apcupsd and act any way you want (e.g.
send you email messages on certain events like line voltage boost, ...).
A Tip from Carl Erhorn for Sun Systems:
It is possible to run the CGI code to monitor your UPS using the answerbook
HTTP server that runs on Solaris. As long as your server has the Answer-
book2 web server installed and running, you can insert the cgi scripts into
the cgi directory of the web server, and access the cgi using something like:
http://hostname:8888/cgi/multimon.cgi
82