I have an APC back-UPS connected to my TP-Link Archer C2600 router. I have setup apcupsd to show graphs in luci as in these instructions
https://openwrt.org/docs/guide-user/services/ups/apcupsd_es500
The graphs are working perfectly and in general apcupsd seems to work fine (e.g. if I enter apcaccess
I get all the information from the UPS).
What I want to do is to send an email alert when there's a power outage.
For that purpose I first setup msmtp and I can send test emails.
I first tried adding the following to /etc/apcupsd/apcupsd.conf
:
EMAILNOTIFY your-email@gmail.com
NOTIFYEMAIL your-email@gmail.com
NOTIFYMSG "Power Outage on UPS!"
However when I restart apcupsd I get error apcupsd FATAL ERROR in apcconfig.c at line 672
.
I then commented out these lines and tried using an additional script to send an email by adding:
ONBATTERY "/etc/apcupsd/poweroutage.sh"
However now I get error apcupsd FATAL ERROR in apcconfig.c at line 672
It seems that apcupsd in openwrt is somewhat stripped down and doesn't include those directives? Any way to make email alerts work?