smeserver-nutUPS/additional/config/upssched.conf

96 lines
3.3 KiB
Plaintext
Raw Permalink Normal View History

# Network UPS Tools - upssched.conf sample file
#
# ============================================================================
#
# CMDSCRIPT <scriptname>
#
# This script gets called to invoke commands for timers that trigger.
# It is given a single argument - the <timername> in your
# AT ... START-TIMER defines.
#
# *** This must be defined *before* the first AT line. Otherwise the
# program will complain and exit without doing anything.
#
# A shell script with a big case..esac construct should work nicely for this.
# An example has been provided to help you get started.
CMDSCRIPT /usr/sbin/upssched-cmd
# ============================================================================
#
# PIPEFN <filename>
#
# This sets the file name of the FIFO that will pass communications between
# processes to start and stop timers. This should be set to some path where
# normal users can't create the file, due to the possibility of symlinking
# and other evil.
#
# NOTE: if you are running Solaris or similar, the permissions that upssched
# sets on this file *are not enough* to keep you safe. If your OS ignores
# the permissions on a FIFO, then you MUST put this in a protected directory!
#
# Another thing to think about: upsmon doesn't run the NOTIFYCMD as root
# unless you run it with -p. So, upssched will probably run as nobody
# or similar unless you give upsmon another user with -u. Either way,
# you have to set PIPEFN to something that ONLY the resulting upsmon
# user can access.
#
# This is commented out by default to make you visit this file and think
# about how your system works before potentially opening a hole.
#
# PIPEFN /var/run/upssched.pipe
# ============================================================================
#
# AT <notifytype> <upsname> <command>
#
# Define a handler for a specific event <notifytype> on UPS <upsname>.
#
# <upsname> can be the special value * to apply this handler to every
# possible value of <upsname>.
#
# Run the command <command> via your CMDSCRIPT when it happens.
#
# Note that any AT that matches both the <notifytype> and the <upsname>
# for the current event will be used.
# ============================================================================
#
# Possible AT commands
#
# - START-TIMER <timername> <interval>
#
# Start a timer called <timername> that will trigger after <interval>
# seconds, calling your CMDSCRIPT with <timername> as the first
# argument.
#
# Example:
# Start a timer that'll execute when any UPS (*) has been gone 10 seconds
#
# AT COMMBAD * START-TIMER upsgone 10
# -----------------------------------------------------------------------
#
# - CANCEL-TIMER <timername> [cmd]
#
# Cancel a running timer called <timername>, if possible. If the timer
# has passed then pass the optional argument <cmd> to CMDSCRIPT.
#
# Example:
# If a specific UPS (myups@localhost) comes back online, then stop the
# timer before it triggers
#
# AT COMMOK myups@localhost CANCEL-TIMER upsgone
# -----------------------------------------------------------------------
#
# - EXECUTE <command>
#
# Immediately pass <command> as an argument to CMDSCRIPT.
#
# Example:
# If any UPS (*) reverts to utility power, then execute
# 'ups-back-on-line' via CMDSCRIPT.
#
# AT ONLINE * EXECUTE ups-back-on-line