HowTo notify admin about ups events

If your server and ups are in the basement and nobody notice the beeping, your server can go down suddenly and nobody knows why. I had a similar issue today and was supprised that there is no possibility for a notification in the ups panel. I though that this would be standard, but it isn’t. To get a notification is not difficult.

1. make a custom template

vi /etc/e-smith/templates-custom/etc/ups/upsmon.conf/30notify

and insert

 # eventnotification
 NOTIFYCMD /etc/ups/

and save it. This will call the exec-function to send a mail and write to syslog.
(More options can be found in upsmon.conf)

2. expand template

expand-template /etc/ups/upsmon.conf

Now the above entries should be in the file upsmon.conf at the end.

3. make an executable notify script

vi /etc/ups/

and insert

 #! /bin/bash
 echo "$*" | sendmail -F"ups@_nethserver.domain.local_" root@_nethserver.domain.local_

change the cursiv written to your specific needs.

Now change owner and make it executable

chown nut:nut /etc/ups/
chmod 700 /etc/ups/

4 . restart upsmon

service ups restart

Now you will receive an email-notification everytime your ups goes on battery and goes back
online again.

Don’t know if this is for interest for anybody, but I needed it today. If there is a better way to do this, I’ll be glad to hear about it.


I have just corrected a little something about formatting

1 Like

looks better now . thanks.