Admittedly, this is not a FreeBSD issue, but I am hoping to take advantage of the level of expertise in this forum to make this work.
I defined the NOTIFYCMD in /usr/local/etc/nut/upsmon.conf as a simple script at /usr/local/bin/mailme which reads as follows.
I got this idea from this excellent NUT documentation. However, the next step described there is restarting upsmon before testing the whole thing by pulling UPS plug off the wall. In my understanding upsmon is a client, not a server. I did reload and restart both nut and upsd services, but I didn't get the email notification as expected by simulating a power outage event. My script is working when I execute it from the command line; however, the message text is understandably empty. I feel like I am very close and any pointers will be greatly appreciated.
I also emailed the nut-users email list with this question for full disclosure. Thanks in advance for the guidance!
I defined the NOTIFYCMD in /usr/local/etc/nut/upsmon.conf as a simple script at /usr/local/bin/mailme which reads as follows.
sh:
#!/usr/bin/env sh
echo "$*" | /usr/bin/mail -s "There is a UPS event!" myemail@example.com
I got this idea from this excellent NUT documentation. However, the next step described there is restarting upsmon before testing the whole thing by pulling UPS plug off the wall. In my understanding upsmon is a client, not a server. I did reload and restart both nut and upsd services, but I didn't get the email notification as expected by simulating a power outage event. My script is working when I execute it from the command line; however, the message text is understandably empty. I feel like I am very close and any pointers will be greatly appreciated.
I also emailed the nut-users email list with this question for full disclosure. Thanks in advance for the guidance!