hakayova via Nut-upsuser <[email protected]> writes:

> I have a working UPS setup on my NAS, which runs FreeBSD14.3. It can
> communicate with the UPS, and both nut and upsd services are running
> as expected. I made the following changes in the upsmon.conf to enable
> email notification to myself:
>
> NOTIFYCMD /usr/local/bin/mailme
> NOTIFYFLAG ONLINE       SYSLOG+WALL+EXEC
> NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC
> NOTIFYFLAG FSD          SYSLOG+WALL+EXEC
> NOTIFYFLAG COMMOK       SYSLOG+WALL+EXEC
> NOTIFYFLAG COMMBAD      SYSLOG+WALL+EXEC
> NOTIFYFLAG SHUTDOWN     SYSLOG+WALL+EXEC
> NOTIFYFLAG REPLBATT     SYSLOG+WALL+EXEC
> NOTIFYFLAG NOCOMM       SYSLOG+WALL+EXEC
> NOTIFYFLAG NOPARENT     SYSLOG+WALL+EXEC
>
> This is the script /usr/local/bin/mailme:
>
> #!/usr/bin/env sh
>
> echo "$*" | /usr/bin/mail -s "Notification for UPS event" [email protected]


  - check that the script is 755 or 555 permissions

  - become the nut user with su, /bin/sh, and clear out the environment.
    Set PATH to dafault.  Then
      /usr/local/bin/mailme foo bar baz
    and see what happens

  - read /var/log/messages and /var/log/maillog, or however you spell
    those logs on your system

_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to