Email notification about UPS power supply

Got a suggestion for future Synology products? Suggest it here!
We'll forward your idea to our RD department.

Re: Email notification about UPS power supply

Postby nicko_mv » Fri Mar 30, 2012 4:32 am

I have tested this, and it works well, however there seems to be an issue where after the unit is restarted you get the 'NAS is back to normal' email - even though it wasnt shut down/restarted due to power - have you any ideas on how to make it only send the email after the NAS has been shut down previously by the UPS or woken by the UPS?
nicko_mv
Student
Student
 
Posts: 66
Joined: Wed Mar 07, 2012 10:27 am

Re: Email notification about UPS power supply

Postby ankushs » Fri Mar 30, 2012 6:03 am

I have also tested this & its working. Thanks :)
There are a few side effects though:
1. As mentioned in the post above mine, an email is sent everytime the NAS is restarted.
2. The NAS restart time has increased due to the sleep commend at the end. I reduced it to 60 seconds from the 360 seconds in the script, but please tell me what is this sleep command for?

Any ideas??
ankushs
I'm New!
I'm New!
 
Posts: 8
Joined: Mon Oct 03, 2011 12:46 pm

Re: Email notification about UPS power supply

Postby quietsy » Fri Mar 30, 2012 2:08 pm

The sleep command was needed for the next command which is used to send the mail UPS is back to normal, without the sleep it was inconsistent because the network was not active during the boot.
You can remove both the sleep and the mail commands if you don't want to receive a mail after each boot.

Do you want me to change it so that it will only send the mail UPS is back to normal after a forced shutdown event?
DS411 - 4 x Seagate 2TB 5900RPM
DS110j - 1 x Seagate 750GB 7200RPM
APC Smart UPS 750VA
IPux ICS2330 Cam
quietsy
Experienced
Experienced
 
Posts: 106
Joined: Tue Oct 11, 2011 12:47 am

Re: Email notification about UPS power supply

Postby ankushs » Fri Mar 30, 2012 5:40 pm

I dont mind the mail after every boot much...I was more concerned about the sleep thing. I have a synology 1010+ & it does start within 60 seconds so the mail is still sent even if I reduce this sleep to 60. Just wanted to reduce the restart time of the DS, if possible.
I guess this is good enough for me...until synology provides something similar officially :)
Thanks :)
ankushs
I'm New!
I'm New!
 
Posts: 8
Joined: Mon Oct 03, 2011 12:46 pm

Re: Email notification about UPS power supply

Postby nicko_mv » Sat Mar 31, 2012 4:25 am

It would be good to get a mail only after a forced shutdown event - in my case I have the emails forwarded to an email to SMS provider - which then forwards an sms to about 4 mobile numbers. Purpose is to monitor the mains power as we have a few power outages and need to crank up the backup generator. Would be good to only get the sms after a forced shutdown event as that way we know that its not just me rebooting the server :)

Thanks!
nicko_mv
Student
Student
 
Posts: 66
Joined: Wed Mar 07, 2012 10:27 am

Re: Email notification about UPS power supply

Postby quietsy » Sat Mar 31, 2012 8:26 pm

This is what you should do so that it will only send a mail after a forced shut down event.
At the end of /usr/syno/bin/synoups add the line in red:
fsd)
/usr/syno/bin/synomail UPSFSD
touch /usr/syno/ups_post_fsd
/usr/syno/sbin/upsmon -c fsd
UPSSafeMode $1
;;
esac

And on /usr/syno/etc.defaults/rc.d/S99UPSMail.sh add the lines in red:
#!/bin/sh

if [ "$1" = "start" ]
then
cp -p /usr/syno/etc/ups/upssched.conf.OK /usr/syno/etc/ups/upssched.conf

if [ -e /usr/syno/ups_post_fsd ]
then
rm -rf /usr/syno/ups_post_fsd

sleep 360
/usr/syno/bin/synomail UPSOnLineBoot
fi
fi

I'm not able to test it but I believe it should work.
Last edited by quietsy on Sat Apr 14, 2012 1:04 am, edited 1 time in total.
DS411 - 4 x Seagate 2TB 5900RPM
DS110j - 1 x Seagate 750GB 7200RPM
APC Smart UPS 750VA
IPux ICS2330 Cam
quietsy
Experienced
Experienced
 
Posts: 106
Joined: Tue Oct 11, 2011 12:47 am

Re: Email notification about UPS power supply

Postby nicko_mv » Sun Apr 01, 2012 10:01 am

DO we just append this to the files that we previously edited? Or do we have to remove any lines in order to take out the previous 'email sent on normal reboot' alert?
Thanks again for your help!
nicko_mv
Student
Student
 
Posts: 66
Joined: Wed Mar 07, 2012 10:27 am

Re: Email notification about UPS power supply

Postby quietsy » Sun Apr 01, 2012 11:15 am

Just append the lines in red to the files that were previously edited in the right locations.
DS411 - 4 x Seagate 2TB 5900RPM
DS110j - 1 x Seagate 750GB 7200RPM
APC Smart UPS 750VA
IPux ICS2330 Cam
quietsy
Experienced
Experienced
 
Posts: 106
Joined: Tue Oct 11, 2011 12:47 am

Re: Email notification about UPS power supply

Postby nicko_mv » Fri Apr 13, 2012 11:54 am

So been running this for a while, and it works, however in our situation the UPS is doing all kind of funny things.... but it sends the 'power on battery' command to the NAS (and thus sends an email) all the time (4+ times a day), and almost immediatley send the 'power returned to normal' command/email. Im assuming probably its the AVR kicking in and I need to adjust the tolerances a little, as we live in the country it could actually be the AC power fluctuations causing this...

Anyway, all that aside, what lines should i comment out to stop the on batt, and power returned to normal emails being sent? I actually also want the 'NAS is back to normal' email to still be sent after a forced shutdown as thats a good indicator of a real power-cut!

Thanks
nicko_mv
Student
Student
 
Posts: 66
Joined: Wed Mar 07, 2012 10:27 am

Re: Email notification about UPS power supply

Postby quietsy » Sat Apr 14, 2012 1:12 am

To stop the on-batt and on-line emails, comment the following lines in red on /usr/syno/bin/synoups:

UPSSendMsg() {
St=`UPSStatusGet`
if [ "$St" = "OL" ]; then
echo "UPS is On-Line"
return
fi
if [ "$St" = "OB" ]; then
echo "UPS is On-Battery"
/usr/syno/bin/synomail UPSDown
SYSLOG "UPS on battery."
return
fi
}

case "$1" in
online)
/usr/syno/bin/synomail UPSUp
UPSRestart
;;
onbatt)
UPSSendMsg $1
;;
DS411 - 4 x Seagate 2TB 5900RPM
DS110j - 1 x Seagate 750GB 7200RPM
APC Smart UPS 750VA
IPux ICS2330 Cam
quietsy
Experienced
Experienced
 
Posts: 106
Joined: Tue Oct 11, 2011 12:47 am

Re: Email notification about UPS power supply

Postby myCloud » Sat Apr 14, 2012 5:42 pm

Thanks so much for the detailed instructions! Synology should put this in the next release of DSM.
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: Email notification about UPS power supply

Postby henkg » Tue Apr 17, 2012 2:35 pm

New DSM 4.0-2219 (2012/04/17)
Most important is the fix for the Samba leak. For this topic:(from the change log)
3.Added a notification event when the DiskStation enters safe mode due to UPS low battery.

I did not test it yet. FW update is in progress ....
DS412+. 1x WD20EFRX + 3x HD204UI, SHR (RAID5). DSM 4.2-3211.
DS210j. 2x HD203WI, RAID1. DSM 4.2-3211.
Router Netgear WNDR3700. Switch TP-Link TL-SG1008D. AcRyan Mini v1. UPS APC BE700G-GR. Ipcam Edimax IC-3010.
henkg
Enlightened
Enlightened
 
Posts: 434
Joined: Sat Sep 25, 2010 8:16 am
Location: Netherlands

Re: Email notification about UPS power supply

Postby nicko_mv » Tue Apr 17, 2012 3:01 pm

Henkg,

Where did you find those release notes?
Thanks
nicko_mv
Student
Student
 
Posts: 66
Joined: Wed Mar 07, 2012 10:27 am

Re: Email notification about UPS power supply

Postby henkg » Tue Apr 17, 2012 3:13 pm

Where they always are:
http://www.synology.com/support/download.php?lang=enu
(select bays / type, first table row. Last column: notes: Release notes)

In notifications,
- 'UPS low battery reached' is added.
- No other new setting (something like 'DS now on battery')
Can't test it now.
DS412+. 1x WD20EFRX + 3x HD204UI, SHR (RAID5). DSM 4.2-3211.
DS210j. 2x HD203WI, RAID1. DSM 4.2-3211.
Router Netgear WNDR3700. Switch TP-Link TL-SG1008D. AcRyan Mini v1. UPS APC BE700G-GR. Ipcam Edimax IC-3010.
henkg
Enlightened
Enlightened
 
Posts: 434
Joined: Sat Sep 25, 2010 8:16 am
Location: Netherlands

Re: Email notification about UPS power supply

Postby Valith » Wed Sep 05, 2012 3:44 pm

henkg wrote:New DSM 4.0-2219 (2012/04/17)
Most important is the fix for the Samba leak. For this topic:(from the change log)
3.Added a notification event when the DiskStation enters safe mode due to UPS low battery.

I did not test it yet. FW update is in progress ....


And was your test successful?
Do we get a notification (e-mail) when the NAS runs on UPS? (power outage) :?:
Synology DS410 (volume1: 3x2TB = RAID5 volume2: 1x2TB) & DS207 128MB (2x500GB RAID1)
Note: DS207 128MB = PowerPC CPU, not a Marvell CPU
2x 500GB 7200rpm 16MB SATA2 Seagate Disks (ST3500830AS)
4x 2TB WD Caviar Green Intellipower 64MB SATA2 (WD20EARS-00MVWB0)
UPS: APC BE700G-GR
Valith
Beginner
Beginner
 
Posts: 25
Joined: Mon May 21, 2007 10:05 pm

PreviousNext

Return to Feature Requests & Product Improvement Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests