# # UPS Daemon # The Wild Wind Communications, 1995, 1996 # # This configuration file is based on the one supplied by Johnny Chin # JTNET (a division of Onesimus Enterprises International, Inc.), 1996 # and originally was for 115V UPS # # Please feel free to use it it as the initial configuration to build # your customized one from. Thank you Jonny! # # # P.S. Another suggestion: the critical messages are sent with # syslog facility, not wall. The idea is to setup your syslogd # to broadcast daemon.emerg messages all over your local network. # # INSTALLER: must should modify the device entry here to reflect # your serial port (default is COM1), also note that this port must # be disabled in your /etc/ttys. # ups "smart-ups" (230) proto "apc-smart" { device "/dev/cuaa0" speed 2400 read-timeout 2 write-block-size 1 write-block-delay 50 queue-size 64 } # # APC Smart-UPS initialization # on "initialize" != "SM" { poll "initialize" after 60 every 60 { log emerg "Cannot initialize APC Smart-UPS into smart mode!" } } # # APC Smart-UPS tuning (configuring Smart-UPS) -- once a day (86400 seconds) # every 86400 { tune "high-transfer-point" 264 tune "low-transfer-point" 196 tune "line-alarm" "0" tune "line-sensitivity" "L" tune "low-batteries-duration" 2 tune "nominal-voltage" 220 tune "shutdown-delay" 180 tune "wakeup-batteries-capacity" 25 tune "wakeup-delay" 0 # tune "batteries-replaced" "01/01/92" # The label below should be exactly eight characters. tune "label" "WildWind" } # # APC Smart-UPS testing -- once a week (604800 seconds) # every 604800 { poll "manufactured" poll "serial" poll "self-test" poll "light-test" } # # APC Smart-UPS PowerChute PLUS polling for operating information # (since they do it every 5 seconds, so will we) # every 5 { poll "high-transfer-point" poll "low-transfer-point" poll "line-frequency" poll "line-maxvac" poll "line-minvac" poll "line-voltage" poll "temperature" # ASSUMPTION: %high-transfer-point% = 264 on "line-voltage" > 264 { log notice "line-voltage: %line-voltage% > %high-transfer-point%" } # ASSUMPTION: %low-transfer-point% = 196 on "line-voltage" < 196 { log notice "line-voltage: %line-voltage% < %low-transfer-point%" } } # # Poll and log the Smart-UPS for operating status every 5 minutes (300 seconds) # every 300 { poll "last-test" # poll "light-test" poll "line-frequency" poll "line-maxvac" poll "line-minvac" poll "line-voltage" poll "load" poll "recharge" poll "temperature" poll "vdc" poll "voltage" # only log noticermation after inital self-test, otherwise errors in log on "load" > 2 { log notice "serial #: %serial%; manufactured: %manufactured%" log notice "last test: %last-test%, light test: %light-test%" log notice "maxvac: %line-maxvac%, minvac: %line-minvac%" log notice "voltage: %line-voltage%, frequency: %line-frequency%, temp: %temperature%C" log notice "load: %load%, recharge: %recharge% percent" log notice "vdc: %vdc%, output voltage: %voltage%" } on "load" > 50 { log notice "*** NOTICE: UPS load is ABOVE NORMAL: %load% ***" } on "load" > 75 { log notice "*** NOTICE: UPS load is HIGH: %load% ***" } on "load" > 90 { log emerg "*** URGENT: UPS load is TOO HIGH: %load% ***" } } # # broadcast a message every 20 seconds while line failure # on "line-fail" every 20 { log emerg "*** ALERT! Source power line failed, logout NOW! ***" } # # contains the broadcast message which is sent by /usr/bin/wall # on "line-restore" { log emerg "*** NOTICE: Source power line restored. ***" } # # RECOMMENDED run-time on battery power are: # 5 minutes ( 300 seconds) # 10 minutes ( 600 seconds) <-- if normal load < 40% # 15 minutes ( 900 seconds) <-- if normal load < 25% # 20 minutes (1200 seconds) # on "line-fail" after 60 { log emerg "***** ALERT! THE SYSTEM IS SHUTTING DOWN NOW! *****" exec "rsh dawn.ww.net '/sbin/halt &'&" exec "rsh sunset.ww.net '/sbin/halt &'&" poll "power-test" poll "power-test" poll "shutdown" sleep 2 exec "/sbin/halt &" poll "power-test" poll "power-test" poll "shutdown" poll "power-test" poll "power-test" poll "shutdown" poll "power-test" poll "power-test" poll "shutdown" sleep 1000 # let us wait peacefully }