Set up email notificaiton when system powers on and about to shut down


Recommended Posts

Hi, i have been wondering, it is possible to set up email notificaiton when system powers on and about to shut down? some of my friends are using my NAS for Plex streaming and some kind of stuff, i shut down and power on automaticaly with tasks every day and some times i shut it down if i know i wont be using it some time (why leave it on when no one is using it)

i would like to automaticaly send emails so they know

is it posible? DSM 6.1.7, DS3615xs

 

Thank you

Link to post
Share on other sites

All things you wanted to know about notifications but you were afraid to ask:

You can set up both events in the Task Manager.

 

1) Notify via DSM UI notification, this will however not be pushed to the mobile app for xpenlogie:

synodsmnotify @administrators System "System is shutting down"

 

2) For official DSM email delivery, create your own notification in Notifications\Advanced:

https://www.beatificabytes.be/send-custom-notifications-from-scripts-running-on-a-synology-new/https://www.beatificabytes.be/send-custom-notifications-from-scripts-running-on-a-synology-new/

then send:

/usr/syno/bin/synonotify Shutdown

 

3) For instant Pushbullet notification, set up notifycli package and run:

/volume1/@appstore/nessentials/bin/notify-cli -c pushbullet -p <PushbulletAPIToken> -d <DeviceIden> -t "NAS Alert" -m "System shutdown" --sender <SourceDeviceIden>

 

4) To get literal audio notification ("System shutdown"), get a free TEXT to MP3 audio file, and play it via:

/volume1/@appstore/AudioStation/bin/mplayer /folder/shuttdown.mp3 > /dev/null 2>&1

BONUS: you can have a script that parses all DSM emails, and plays according text via USB speaker

 

5)  To send email without any configurations, no questions asked (if you're running MailServer):

echo -e "From: NAS <nas@domain.tld>\nTo: nas@domain.tld\nSubject: NAS alert\n\nSystem shutdown" | ssmtp nas@domain.tld

BONUS: you can automatically forward the email to your SMS if your telco provides such service

 

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.