Jump to content
XPEnology Community

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


Recommended Posts

Posted

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

Posted

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
  • 2 years later...
Posted

BTW in DSM7 they murdered the super easy way nr.1, and i'm tired to prep nr.2 as well, but wait, Arc is here once again to help, so you can just use this out of the box:

 

1) dynamic notifications without any pre setting, displaying in a persistent way in the GUI, without email:

synodsmnotify "@administrators" "arc_notify_subject" "{\"%NOTIFICATION%\": \"notification\", \"%SUBJECT%\": \"subject\"}"

not bad!

 

6) finally you want to insert records to the official Log Center:

synologset1 sys info 0x11100000 "message"

 

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.

×
×
  • Create New...