I did the following:
config setprop nut status enabled
config setprop nut Model megatec_usb
config setprop nut Type auto
/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYCMD:
NOTIFYCMD /usr/sbin/upssched
/etc/e-smith/templates/etc/ups/upssched.conf/01CONFIG:
CMDSCRIPT /sbin/e-smith/nutUPS.cmd
PIPEFN /tmp/upspipe
LOCKFN /tmp/upslock
AT COMMBAD * EXECUTE commbad
AT COMMOK * EXECUTE commok
AT NOCOMM * EXECUTE nocomm
AT ONBATT * EXECUTE powerout
AT ONBATT * START-TIMER shutdownnow 60 <------ Set this to how many seconds after ONBATT signal you want to shut down
AT LOWBATT * EXECUTE shutdowncritical
AT ONLINE * CANCEL-TIMER shutdownnow
AT ONLINE * EXECUTE powerup
/sbin/e-smith/nutUPS.cmd:
#! /bin/sh
case $1 in
commbad)
/bin/echo "UPS communications failure on `date`." | /bin/mail -s"UPS communications LOST" admin
/usr/bin/wall "UPS communications failure."
;;
commok)
/bin/echo "UPS communications restored on `date`." | /bin/mail -s"UPS communications restored" admin
/usr/bin/wall "UPS communications restored."
;;
nocomm)
/bin/echo "UPS communications cannot be established on `date`." | /bin/mail -s"UPS uncontactable" admin
/usr/bin/wall "UPS communications cannot be established."
;;
powerout)
/bin/echo "Power failure on `date`." | /bin/mail -s"UPS on battery" admin
/usr/bin/wall "UPS on battery. Shutdown in 60 seconds...."
;;
shutdownnow)
/bin/echo "UPS has been on battery for 60 seconds. Starting orderly shutdown on `date`." | /bin/mail -s"UPS on battery for 60 seconds" admin
/usr/bin/wall "UPS has been on battery for 60 seconds. Shutting down NOW!!!!"
/usr/bin/sudo /sbin/e-smith/signal-event halt
;;
shutdowncritical)
/bin/echo "UPS battery level CRITICAL. Starting EMERGENCY shutdown on `date`." | /bin/mail -s"UPS battery CRITICAL" admin
/usr/bin/wall "UPS battery level CRITICAL. Shutting down NOW!!!!"
/usr/bin/sudo /sbin/e-smith/signal-event halt
;;
powerup)
/bin/echo "Power restored on `date`." | /bin/mail -s"UPS on line" admin
/usr/bin/wall "UPS on line. Shutdown aborted."
;;
*)
/bin/echo "Unrecognized command: $1"
;;
esac
/etc/e-smith/templates/etc/sudoers/30nut:
nut ALL=NOPASSWD: ALL
signal-event post-upgrade
signal-event reboot
It ain't pretty, but it works.