# upsmon.conf # # $Id: upsmon.conf 577 2006-03-16 19:31:27Z jhealy $ # # Crufted up by Jason Healy (Suffield Academy) # # Defines the behavior of this UPS monitoring daemon. # YOU MUST CUSTOMIZE THIS FILE BEFORE RUNNING NUT! # # See the comments containing "suffield" for points to edit. # # RUN_AS_USER nut_upsmon # -------------------------------------------------------------------------- # MONITOR ("master"|"slave") # # The Suffield config assumes that you are a slave and wish to monitor # our UPS master host. # # You must fill in the UPS name on the host, along with the username # and password for this machine. # # The "1" is the number of power supplies fed from this UPS to this box. # Most servers have only one power supply, so this should stay as 1. # # Uncomment the line below and change "upsname", "username", and "password" # to the correct values for this machine. # suffield: edit the line below to point to a real UPS instance # MONITOR upsname@upsmaster.suffieldacademy.org 1 username password slave # -------------------------------------------------------------------------- # MINSUPPLIES # # Give the number of power supplies that must be receiving power to keep # this system running. Most systems have one power supply, so you would # put "1" in this field. MINSUPPLIES 1 # -------------------------------------------------------------------------- # SHUTDOWNCMD "" # # upsmon runs this command when the system needs to be brought down. SHUTDOWNCMD "/sbin/shutdown -h +0" # -------------------------------------------------------------------------- # NOTIFYCMD # # suffield: Use upssched to schedule other actions based upon the UPS # event. See NOTIFYFLAG below for events types, and # /usr/local/nut_upsmon/etc/upssched.conf for more details. # (you do not have to customize this line; see upssched.conf instead) NOTIFYCMD /usr/local/nut_upsmon/sbin/upssched # -------------------------------------------------------------------------- # POLLFREQ # # Polling frequency for normal activities, measured in seconds. POLLFREQ 25 # -------------------------------------------------------------------------- # POLLFREQALERT # # Polling frequency in seconds while UPS on battery. POLLFREQALERT 5 # -------------------------------------------------------------------------- # HOSTSYNC - How long upsmon will wait before giving up on another upsmon # # The master upsmon process uses this number when waiting for slaves to # disconnect once it has set the forced shutdown (FSD) flag. If they # don't disconnect after this many seconds, it goes on without them. # # Similarly, upsmon slave processes wait up to this interval for the # master upsmon to set FSD when a UPS they are monitoring goes critical - # that is, on battery and low battery. If the master doesn't do its job, # the slaves will shut down anyway to avoid damage to the file systems. # # This "wait for FSD" is done to avoid races where the status changes # to critical and back between polls by the master. HOSTSYNC 15 # -------------------------------------------------------------------------- # DEADTIME - Interval to wait before declaring a stale ups "dead" # # upsmon requires a UPS to provide status information every few seconds # (see POLLFREQ and POLLFREQALERT) to keep things updated. If the status # fetch fails, the UPS is marked stale. If it stays stale for more than # DEADTIME seconds, the UPS is marked dead. # # A dead UPS that was last known to be on battery is assumed to have gone # to a low battery condition. This may force a shutdown if it is providing # a critical amount of power to your system. # # Note: DEADTIME should be a multiple of POLLFREQ and POLLFREQALERT. # Otherwise you'll have "dead" UPSes simply because upsmon isn't polling # them quickly enough. Rule of thumb: take the larger of the two # POLLFREQ values, and multiply by 3. DEADTIME 60 # -------------------------------------------------------------------------- # POWERDOWNFLAG - Flag file for forcing UPS shutdown on the master system # # upsmon will create a file with this name in master mode when it's time # to shut down the load. You should check for this file's existence in # your shutdown scripts and run 'upsdrvctl shutdown' if it exists. # # See the shutdown.txt file in the docs subdirectory for more information. POWERDOWNFLAG /etc/killpower # -------------------------------------------------------------------------- # NOTIFYMSG - change messages sent by upsmon when certain events occur # # You can change the stock messages to something else if you like. # # NOTIFYMSG "message" # # NOTIFYMSG ONLINE "UPS %s is getting line power" # NOTIFYMSG ONBATT "Someone pulled the plug on %s" # # Note that %s is replaced with the identifier of the UPS in question. # # Possible values for : # # ONLINE : UPS is back online # ONBATT : UPS is on battery # LOWBATT : UPS has a low battery (if also on battery, it's "critical") # FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown") # COMMOK : Communications established with the UPS # COMMBAD : Communications lost to the UPS # SHUTDOWN : The system is being shutdown # REPLBATT : The UPS battery is bad and needs to be replaced # NOCOMM : A UPS is unavailable (can't be contacted for monitoring) # -------------------------------------------------------------------------- # NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur # # By default, upsmon sends walls (global messages to all logged in users) # and writes to the syslog when things happen. You can change this. # # NOTIFYFLAG [+][+] ... # # NOTIFYFLAG ONLINE SYSLOG # NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC # # Possible values for the flags: # # SYSLOG - Write the message in the syslog # WALL - Write the message to all users on the system # EXEC - Execute NOTIFYCMD (see above) with the message # IGNORE - Don't do anything # # If you use IGNORE, don't use any other flags on the same line. # suffield: this file is usually for slave systems, so don't warn of # conditions that we have no control over (low batteries, etc) # We let the master server worry about those... NOTIFYFLAG REPLBATT IGNORE NOTIFYFLAG COMMBAD IGNORE NOTIFYFLAG COMMOK IGNORE # suffield: Notify upssched of certain events, so it can begin a shutdown # early (if desired). Note that by default, these notififications # are ignored! # BE SURE TO CUSTOMIZE /usr/local/ups/etc/upssched.conf! NOTIFYFLAG ONBATT WALL+SYSLOG+EXEC NOTIFYFLAG ONLINE WALL+SYSLOG+EXEC NOTIFYFLAG LOWBATT WALL+SYSLOG+EXEC NOTIFYFLAG FSD WALL+SYSLOG+EXEC # Defaults for slaves RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5