[Nut-upsuser] Apple Mac slave

Roger Price roger at rogerprice.org
Sat Jun 10 08:02:36 UTC 2017


On Fri, 9 Jun 2017, Robbie van der Walle wrote:

> ... and also still open is the notification on the Mac.

If notify-send is available on the Mac, then perhaps this will work:

In upsmon.conf on the Mac you need

NOTIFYCMD /usr/sbin/upssched        (or wherever this goes on a Mac)
NOTIFYFLAG ONBATT SYSLOG+EXEC

In upssched.conf you need

CMDSCRIPT /usr/sbin/upssched-cmd    (or wherever this goes on a Mac)
AT ONBATT UPS at NAS EXECUTE on-battery

In upssched-cmd you need

case $1 in
    (on-battery) MSG="Power failure. Save your work!"
                 notify-send -a nut -u critical -t 600000 $MSG ;;
    (*) logger -i -t upssched-cmd "Unrecognized command: \"$1\"." ;;
esac

Roger



More information about the Nut-upsuser mailing list