Author: Kern Sibbald

# Configuration Examples

## A Simple Configuration

You have a Smart UPS using the cable supplied by APC. A very simple configuration file would look like the following:

    ## apcupsd.conf v1.1 ##
    UPSCABLE smart
    UPSTYPE smartups
    DEVICE /dev/ttyS0
    LOCKFILE /var/lock
    UPSCLASS standalone
    UPSMODE disable

Normally you would have many more configuration directives to completely customize your installation, but this example shows you the minimum required.

## A Simple Master Configuration

You have a Smart UPS using the cable supplied by APC and you want it to act as a master for another computer, which is powered by the same UPS. A very simple configuration file would look like the following:

    ## apcupsd.conf v1.1 ##
    UPSCABLE smart
    UPSTYPE smartups
    DEVICE /dev/ttyS0
    LOCKFILE /var/lock
    UPSCLASS netmaster
    UPSMODE net
    NETTIME 10
    NETPORT 6666
    SLAVE slave1.mynetwork.com
    SLAVE slave2.mynetwork.com

Note, the main difference from the stand alone configuration si that you have specified UPSCLASS netmaster and UPSMODE net. In addition, you have specified one or more slave machines.

## A Simple Slave Configuration

You have a Smart UPS using the cable supplied by APC that is connected to the master machine configured above. This slave machine has no serial port connection to the UPS, but is powered by the same UPS as the master. A very simple configuration file would look like the following:

    ## apcupsd.conf v1.1 ##
    UPSCABLE ether
    UPSTYPE smartups
    LOCKFILE /var/lock
    UPSCLASS netslave
    UPSMODE net
    NETPORT 6666
    MASTER master.mynetwork.com

The main difference from the master configuration is that you have specified UPSCABLE ether and UPSCLASS netslave. In addition, you have specified a single controlling master.

In this configuration, the shutdown will be initiated by the master. It is also possible to specify BATTERYLEVEL, MINUTES, and TIMOUT configuration directives in the Slave machine that will cause the slave to shutdown before the master. This can often be useful if the slave is less important than the master and you wish to reduce battery power consumption so that the master can remain up longer during a power outage.

## Variation on the Master/Slave Configuration

It is also possible to have a Master/Slave configuration where the Slave is powered by a different UPS (or any other power source), but is nevertheless controlled (i.e. shutdown) by the master. The setup would be identical to the Master/Slave configuration files shown above. The only difference is where the slave actually receives its power. In effect, apcupsd does not know or care where the power really comes from.