Multi-UPS Configuration (apcupsd 3.8.3 only) --------------------- serial port ------ | | <============> | | | Computer A running | Power | UPS | | two copies of | <============= | 1 | | apcupsd | ------ | | serial port ------ | | <============> | | --------------------- | UPS | | ==== | 2 | | Ethernet || ------ | || --------------------- || | | || | Computer B running | || | apcupsd in | Power || | slave mode | <=========== | | | | ---------------------
./configure \ --prefix=/usr \ --sbindir=/sbin \ --with-cgi-bin=/home/http/cgi-bin \ --enable-cgi \ --with-css-dir=/home/http/css \ --with-log-dir=/etc/apcupsd \ --with-serial-dev=/dev/ttyS0 \ --enable-pthreads \ --with-nis-port=3551 \ --enable-powerfluteThis is pretty much a "normal" installation using many of the defaults. Once built and installed, this would control the first UPS and cause a shutdown of the system when the batteries are low. This copy of apcupsd will be started and stopped automatically when the system is booted and halted.
./configure \ --prefix=$HOME/apcupsd/bin \ --sbindir=$HOME/apcupsd/bin \ --enable-cgi \ --with-cgi-bin=$HOME/apcupsd/bin \ --with-log-dir=$HOME/apcupsd/bin \ --with-pid-dir=$HOME/apcupsd/bin \ --sysconfdir=$HOME/apcupsd/bin \ --with-lock-dir=$HOME/apcupsd/bin \ --with-pwrfail-dir=$HOME/apcupsd/bin \ --with-serial-dev=/dev/ttyS1 \ --enable-pthreads \ --with-nis-port=7001 \ --disable-install-distdirNote, in this case, we use considerably more configuration options to ensure that the system files are placed in a different directory ($HOME/apcupsd/bin). We have also selected a different serial port and a different NIS (Network Information Server) port. And finally, we have used the --disable-install-distdir option, which prevents make install from doing the final system installation (i.e. the modification of the halt script) since this was previously done.
If Computer B is vitally important, it would probably be better to purchase a serial port card for it, or perhaps use a USB UPS. To ensure that it is properly shutdown if Computer A goes down, you could run a second copy of apcupsd on Computer B as a slave connected to the main copy of apcupsd on Computer A. Thus Computer B would be running two slaves, one driven by the master controlling UPS 1 and the other by the master controlling UPS 2, and Computer B could be shutdown by the first master that signaled it to do so.