# /etc/openupsd.conf -- openupsd configuration file # Hacked up by Fred Barnes, 2003 # LOG # where messages are sent (about anything interesting). either a file-name (appended) or SYSLOG LOG SYSLOG # PIDFILE # where the running process's PID should be written #PIDFILE /var/run/openupsd.pid # syntax: DEVICE --- # sets the serial device, device options and inter-poll time for serial devices (can have >1) # is just some generic name that is used to identify each device. Names must be defined # before they can be referred to (including network devices) DEVICE UPS1 /dev/ttyS0 2400-8-N-1 20 #DEVICE UPS2 /dev/ttyS1 2400-8-N-1 20 yeah, I wish ;) # NETCLIENT TCP : [RETRY time] # NETCLIENT TCP UPSremote 192.168.1.1:401 RETRY 10 # OUTPUT # where the data goes (not generated if not present) # Note: using the same file for >1 device will probably not do what you want OUTPUT UPS1 /tmp/openupsd OUTPUT UPSremote /tmp/openupsd.1 # generally, can be * for all, or a comma-seperated list of names # where * is specified, all DEVICEs currently known are used for output # TRIGGER defines a new trigger condition # general syntax: TRIGGER "" # where is one of the output field names, cmp is one of the relational operators =, !=, <, <=, > or >= # the depends on what the is. for numeric fields, it's obvious.. # for the (single) string field "model", = and != may be used with as a quoted string # for status fields, = and != may be used with as a quoted string containing status strings meaning "these set" or "these not set" TRIGGER POWERFAIL "status-field" = "on-battery" TRIGGER POWERRESTORE "status-field" != "on-battery" # INVALIDATE determines what alarms should be invalidated when another one goes off. # syntax is: INVALIDATE WHEN # where and are triggers already defined with TRIGGER INVALIDATE POWERFAIL WHEN POWERRESTORE INVALIDATE POWERRESTORE WHEN POWERFAIL TRIGGER OVERLOAD "status-field" = "overload" TRIGGER NOOVERLOAD "status-field" != "overload" INVALIDATE OVERLOAD WHEN NOOVERLOAD INVALIDATE NOOVERLOAD WHEN OVERLOAD TRIGGER OVERLOAD1 "output-load" > 90 TRIGGER NOOVERLOAD1 "output-load" < 85 INVALIDATE OVERLOAD1 WHEN NOOVERLOAD1 INVALIDATE NOOVERLOAD1 WHEN OVERLOAD1 TRIGGER LOWMAINS "input-voltage" < 230 TRIGGER NOLOWMAINS "input-voltage" >= 230 TRIGGER HIGHMAINS "input-voltage" > 240 TRIGGER NOHIGHMAINS "input-voltage" <= 240 INVALIDATE LOWMAINS WHEN NOLOWMAINS INVALIDATE NOLOWMAINS WHEN LOWMAINS INVALIDATE HIGHMAINS WHEN NOHIGHMAINS INVALIDATE NOHIGHMAINS WHEN HIGHMAINS INVALIDATE LOWMAINS WHEN HIGHMAINS INVALIDATE HIGHMAINS WHEN LOWMAINS # ALARM sets up an action to be performed when something changes. # general syntax is: ALARM [INITIAL] [AFTER delay] # supported s are: # POWERFAIL - switched to battery for whatever reason # POWERRESTORE - switched to mains supply # OVERLOAD - gone into overload # NOOVERLOAD - no longer overloaded # # the INITIAL flag causes the alarm to be generated if the device exhibits the # alarm state when the software is started. Otherwise alarms are only generated # based on state change. Whether you want this or not will probably depend on # local configuration. # ALARM * POWERFAIL INITIAL LOG ALARM * POWERRESTORE INITIAL LOG ALARM * OVERLOAD INITIAL LOG ALARM * NOOVERLOAD INITIAL LOG ALARM * OVERLOAD1 INITIAL LOG ALARM * NOOVERLOAD1 INITIAL LOG ALARM * HIGHMAINS INITIAL LOG ALARM * LOWMAINS INITIAL LOG # after 3 minutes, it's serious.. ALARM * POWERFAIL AFTER 180 EXEC /etc/openupsd/powerfailing.sh # if the power has been gone for 5 mins begin shutdown ALARM * POWERFAIL INITIAL AFTER 300 EXEC /etc/openupsd/powerdown.sh # tell user when something load is high ALARM * OVERLOAD1 EXEC /etc/openupsd/loadhigh.sh ALARM * NOOVERLOAD1 EXEC /etc/openupsd/loadlow.sh # NETSERVER TCP : [ALLOW [ALLOW ...]] [DENY [DENY ...]] # allow connections from remote clients, to whom we'll send UPS data # WIBNI: NETSERVER BROADCAST 192.168.1.255 SSL teddy.pond.net NETSERVER TCP * 192.168.1.1:401 ALLOW 192.168.1.0/24 DENY 192.168.1.222/32 #NETSERVER TCP * *:23959