Previous Next Table of Contents

4. Installation

To install smupsd, install the RPM with rpm or glint.

NOTE: If upgrading smupsd, you should shut down the currently running version first.

Connect your Smart-UPS to your system with the APC Smart Signalling Cable included with the APC PowerChute product.

Create a symbolic link from the serial device (to which the Smart-UPS is attached) to /dev/ups, e.g.,

ln -s /dev/cua0 /dev/ups

Alternately, edit /etc/rc.d/init.d/smupsd.init and change the device name passed in on the command line.

Start the daemon as root either by rebooting, or manually:

/etc/rc.d/init.d/smupsd.init start

Watch for log messages in /var/log/messages. When the daemon starts, you should see something like the following:

Nov 14 10:27:09 devil smupsd: Monitoring UPS on /dev/ups
Nov 14 10:27:09 devil smupsd: Listening for messages on port 4321
Nov 14 10:27:09 devil smupsd: Logging to file /var/log/smupsd
Nov 14 10:27:09 devil smupsd: UPS battery charge level is 100%

If you don't quite trust this daemon, you can run it in debug mode by passing it the -d flag on the command line. In debug mode, smupsd will monitor the Smart-UPS, but will not actually shut your system down or power down the Smart-UPS. To pass smupsd the -d flag, edit the smupsd.init file as mentioned above.

Alternately, you might wish to start smupsd with the -p flag, which inhibits smupsd from commanding the Smart-UPS to power down after your Linux system has shut down. This can be useful if you are powering multiple systems from a single Smart-UPS, but you only want one of the systems commanding the UPS to power down.

Note that with current versions of kernel 2.0.X and LinuxThreads, the daemon process will show up multiple times in the process table because the kernel currently assigns different process IDs to each thread. This looks funny, but is harmless.

If you have additional Linux systems running on the same Smart-UPS, you can still use smupsd to shut them down. You pass the name of the host which is physically connected to the Smart-UPS to the smupsd running on a slave machine wtih the -h flag.

The upsmon graphical tool can be used to monitor selected UPS parameters live from any host by starting it with the name of the host to which the Smart-UPS is attached as the only command line argument. If no argument is specified, upsmon monitors localhost.

By default, smupsd will accept network requests from upsmon or another smupsd that originate from any host. Depending on your network configuration, this could present a security problem. When smupsd is started with the -s option, it obeys the parameters in the network access configuration files /etc/hosts.allow and /etc/hosts.deny as described in the the hosts_access(5) man page. Note that only numeric host addresses are currently supported.

For example, to restrict the use of the upsmon program from any host but the one on which smupsd is running (i.e., localhost), pass the -s flag to smupsd in the smupd.init file and add the following to /etc/hosts.allow:

smupsd: 127.0.0.1

When logging to a file, smupsd only logs numeric information separated by white space to make it easier to produce reports from the logs. For example, one might import a log file directly into a spreadsheet program and graph UPS battery temperature over the course of a week. The data written to the log file is, in order:

  1. Date of last UPS sample (localized format).
  2. Time of last UPS sample (localized format).
  3. Battery charge (percent).
  4. Output load (percent).
  5. Input line voltage.
  6. Minimum input line voltage.
  7. Maximum input line voltage.
  8. Output voltage.
  9. Output frequency (Hz).
  10. Battery voltage.
  11. Battery temperature (C).

The log file will look something like this:

08/18/97 14:55:00 100 29 122.2 118.9 122.8 122.2 60.00 27.6 31.9
08/18/97 15:05:10 100 29 122.8 118.3 122.8 122.8 60.00 27.6 31.9
08/18/97 15:15:09 100 29 120.9 119.6 122.8 122.8 60.00 27.6 31.9
08/18/97 15:25:11 100 29 121.5 120.2 123.5 121.5 60.00 27.6 31.9


Previous Next Table of Contents