Leirasom nincs, a manual alapjan irtam magamnak konfigokat.
Tul sok idom nincs most, inkabb elkuldom a konfig file-okat, amikkel nalam megy (Debian Squeeze):
/etc/nut/nut.conf
MODE=standalone
/etc/nut/ups.conf
# Eaton PowerWare UPS (USB cable)
[bcmxcp-usb]
driver=bcmxcp_usb
port=auto
/etc/nut/upsd.conf
LISTEN 127.0.0.1
/etc/nut/upsd.users
[admin]
password=<jelszo>
actions=set
instcmds=all
upsmon=master
[upsmon]
password=<jelszo>
instcmds=all
upsmon=master
/etc/nut/upsmon.conf
MONITOR bcmxcp-usb@localhost 1 upsmon <jelszo> master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
POWERDOWNFLAG /etc/killpower
RBWARNTIME 86400
# NOTIFYCMD <command>
#
# upsmon calls this to send messages when things happen
#
# This command is called with the full text of the message as one argument.
# The environment string NOTIFYTYPE will contain the type string of
# whatever caused this event to happen.
#
# Note that this is only called for NOTIFY events that have EXEC set with
# NOTIFYFLAG. See NOTIFYFLAG below for more details.
NOTIFYCMD /etc/nut/notify
# NOTIFYMSG - change messages sent by upsmon when certain events occur
#
# NOTIFYMSG <notify type> "message"
#
# Note that %s is replaced with the identifier of the UPS in question.
NOTIFYMSG ONLINE "UPS on line power"
NOTIFYMSG ONBATT "UPS on battery"
NOTIFYMSG LOWBATT "UPS battery is low"
NOTIFYMSG FSD "Forced shutdown in progress"
NOTIFYMSG COMMOK "Communications with UPS established"
NOTIFYMSG COMMBAD "Communications with UPS lost"
NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT "UPS battery needs to be replaced"
NOTIFYMSG NOCOMM "UPS is unavailable"
NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"
# 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 <notify type> <flag>[+<flag>][+<flag>] ...
#
# 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
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
NOTIFYFLAG COMMOK SYSLOG+EXEC
NOTIFYFLAG COMMBAD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
NOTIFYFLAG REPLBATT SYSLOG+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
NOTIFYFLAG NOPARENT SYSLOG+EXEC
Vegul a notify szkript, az apcupsd-hez hasonloan:
/etc/nut/notify
#! /bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
run_dir="/etc/nut/notify.d"
notify_command="$run_dir/$(echo "$NOTIFYTYPE" | awk '{ print tolower($0) }')"
if [ -x "$notify_command" ]; then
exec "$notify_command" "$@"
fi
exit 0
Az
/etc/nut/notify.d
-ba teszed az esemenyekhez tartozo szkripteket (amik peldaul kuldenek egy levelet).