[GH-ISSUE #59] email output from Synology Task Scheduler #71

Open
opened 2026-03-12 18:48:22 +03:00 by kerem · 8 comments
Owner

Originally created by @mikeletoh on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/007revad/Synology_SMART_info/issues/59

Hi newbie here. I'm following the steps to schedule a script in Synology Task Scheduler from here https://github.com/007revad/Synology_SMART_info/blob/main/how_to_schedule.md. However, I seem to be stuck in getting the program to send me details of the hard drives' output to my email. I can see the output in Windows using Putty, but not as far as scheduling the Task Scheduler to push the output to email. I know the script is running correctly because I created a folder in Synology for the output and it goes there by the name of output.log each time I run the script. I've tried running the script without the "--email" and it still won't send me the output to my email. Perhaps I'm missing a command here?

Originally created by @mikeletoh on GitHub (Jan 12, 2026). Original GitHub issue: https://github.com/007revad/Synology_SMART_info/issues/59 Hi newbie here. I'm following the steps to schedule a script in Synology Task Scheduler from here https://github.com/007revad/Synology_SMART_info/blob/main/how_to_schedule.md. However, I seem to be stuck in getting the program to send me details of the hard drives' output to my email. I can see the output in Windows using Putty, but not as far as scheduling the Task Scheduler to push the output to email. I know the script is running correctly because I created a folder in Synology for the output and it goes there by the name of output.log each time I run the script. I've tried running the script without the "--email" and it still won't send me the output to my email. Perhaps I'm missing a command here?
Author
Owner

@007revad commented on GitHub (Jan 12, 2026):

If you have scheduled the script to run with -i or --increased option to only send you an email when important SMART values have changed you want to tick "Send run details only when the script terminates abnormally".
Image

If you have scheduled the script to run without -i or --increased option you want to untick "Send run details only when the script terminates abnormally" so Task Scheduler will send you an email every time the script runs.
Image

For Task Scheduler to send you an email you need to have setup and email address and server for the sender, and an email address for the recipient, in "Control Panel > Notification > Email > Email". And click the Setup button to setup the email server to use to send emails.
Image

<!-- gh-comment-id:3736758333 --> @007revad commented on GitHub (Jan 12, 2026): If you have scheduled the script to run with -i or --increased option to only send you an email when important SMART values have changed you want to tick "Send run details only when the script terminates abnormally". <img width="530" height="405" alt="Image" src="https://github.com/user-attachments/assets/e744acbc-52cc-4708-8afc-3feca1425030" /> If you have scheduled the script to run **without** -i or --increased option you want to **untick** "Send run details only when the script terminates abnormally" so Task Scheduler will send you an email every time the script runs. <img width="528" height="400" alt="Image" src="https://github.com/user-attachments/assets/79d12956-4d56-4220-80d0-9969ccef24d5" /> For Task Scheduler to send you an email you need to have setup and email address and server for the sender, and an email address for the recipient, in "Control Panel > Notification > Email > Email". And click the Setup button to setup the email server to use to send emails. <img width="755" height="418" alt="Image" src="https://github.com/user-attachments/assets/6447d926-9017-4185-b561-eaf2f8d93594" />
Author
Owner

@mikeletoh commented on GitHub (Jan 12, 2026):

Dave, thank you for the quick response. From your reply, I came to realize I misunderstood what the script was meant to do. And that is that the script was intended to ran its program and subsequently provide a notice via email that the script ran correctly or abnormally. I mistakenly assumed that the script would also push out an email of a printout or a result of the SMART overall-health self-assessment of the drives such as when selecting Control Panel, Task Scheduler, Action, View Result. To view the result, one would have had to save the output results to a folder created from the Settings of the Task in Task Scheduler. I followed the setup you provided above trying both options -i and -e, but unfortunately no emails were generated even though my email notifications were set up and my test email went fine. Perhaps I need to add a rule or correctly select a rule for the event that would match the script in the task scheduler. For now, I'm satisfied and pleased that I at least have an option to view the health info of the hard drives which Synology took away in the Storage Manager.

<!-- gh-comment-id:3736882961 --> @mikeletoh commented on GitHub (Jan 12, 2026): Dave, thank you for the quick response. From your reply, I came to realize I misunderstood what the script was meant to do. And that is that the script was intended to ran its program and subsequently provide a notice via email that the script ran correctly or abnormally. I mistakenly assumed that the script would also push out an email of a printout or a result of the SMART overall-health self-assessment of the drives such as when selecting Control Panel, Task Scheduler, Action, View Result. To view the result, one would have had to save the output results to a folder created from the Settings of the Task in Task Scheduler. I followed the setup you provided above trying both options -i and -e, but unfortunately no emails were generated even though my email notifications were set up and my test email went fine. Perhaps I need to add a rule or correctly select a rule for the event that would match the script in the task scheduler. For now, I'm satisfied and pleased that I at least have an option to view the health info of the hard drives which Synology took away in the Storage Manager.
Author
Owner

@007revad commented on GitHub (Jan 12, 2026):

My emails contain everything that the script shows via SSH (though the email messes up the formatting a bit).
Image


And with the -i option and the scheduled task set to only "Send run details only when the script terminates abnormally" I get an email like this when any of important SMART values change.
Image

<!-- gh-comment-id:3736989044 --> @007revad commented on GitHub (Jan 12, 2026): My emails contain everything that the script shows via SSH (though the email messes up the formatting a bit). <img width="728" height="756" alt="Image" src="https://github.com/user-attachments/assets/2824b2a4-66a4-45a6-a72d-5db2a94dc5d7" /> </br> And with the -i option and the scheduled task set to only "Send run details only when the script terminates abnormally" I get an email like this when any of important SMART values change. <img width="728" height="415" alt="Image" src="https://github.com/user-attachments/assets/2155d3ff-6839-4392-b150-85db9f98f581" />
Author
Owner

@mikeletoh commented on GitHub (Jan 12, 2026):

Hi Dave,

Below is what I get I get from Putty using the run command sudo -s /volume1/Scripts/Smart/syno_smart_info.sh
In the Task Settings in Task Scheduler my user-defined script is: /volume1/Scripts/Smart/syno_smart_info.sh -e
I don't receive any emails through from the script. I noticed you are using smartcl 7.5 while I'm on smartcl 6.5. Maybe that's the issue.

Synology_SMART_info v1.4.34 - by 007revad
DS1019 DS1019+ DSM 7.2.1-69057-6
Using smartctl 6.5

There is a newer version of this script available.
Current version: v1.4.34
Latest version: v1.4.35
Run syno_smart_info.sh -u to update.

Drive 1 WD140EDFZ-11A0VA0 9LG7DREG /dev/sda
SMART overall-health self-assessment test result: PASSED
SMART Error Counter Log: 2
1 Raw_Read_Error_Rate 0
5 Reallocated_Sector_Ct 0
7 Seek_Error_Rate 65536
9 Power_On_Hours 35617
10 Spin_Retry_Count 0
194 Temperature_Celsius 35
197 Current_Pending_Sector 0
198 Offline_Uncorrectable 0
199 UDMA_CRC_Error_Count 0

<!-- gh-comment-id:3737121662 --> @mikeletoh commented on GitHub (Jan 12, 2026): Hi Dave, Below is what I get I get from Putty using the run command sudo -s /volume1/Scripts/Smart/syno_smart_info.sh In the Task Settings in Task Scheduler my user-defined script is: /volume1/Scripts/Smart/syno_smart_info.sh -e I don't receive any emails through from the script. I noticed you are using smartcl 7.5 while I'm on smartcl 6.5. Maybe that's the issue. Synology_SMART_info v1.4.34 - by 007revad DS1019 DS1019+ DSM 7.2.1-69057-6 Using smartctl 6.5 There is a newer version of this script available. Current version: v1.4.34 Latest version: v1.4.35 Run syno_smart_info.sh -u to update. Drive 1 WD140EDFZ-11A0VA0 9LG7DREG /dev/sda SMART overall-health self-assessment test result: PASSED SMART Error Counter Log: 2 1 Raw_Read_Error_Rate 0 5 Reallocated_Sector_Ct 0 7 Seek_Error_Rate 65536 9 Power_On_Hours 35617 10 Spin_Retry_Count 0 194 Temperature_Celsius 35 197 Current_Pending_Sector 0 198 Offline_Uncorrectable 0 199 UDMA_CRC_Error_Count 0
Author
Owner

@007revad commented on GitHub (Jan 12, 2026):

You should get the exact same thing from task scheduler, but with a header like:

Task Scheduler has completed a scheduled task.

Task: SMART Info
Start time: Mon, 12 Jan 2026 20:36:10 +1100
Stop time: Mon, 12 Jan 2026 20:36:19 +1100
Current status: 0 (Normal)
Standard output/error:

It works with smartctl 6.5 or 7.5

Can you provide a screenshot of the scheduled task's Task Settings tab. Like this one:
Image

<!-- gh-comment-id:3737676412 --> @007revad commented on GitHub (Jan 12, 2026): You should get the exact same thing from task scheduler, but with a header like: ``` Task Scheduler has completed a scheduled task. Task: SMART Info Start time: Mon, 12 Jan 2026 20:36:10 +1100 Stop time: Mon, 12 Jan 2026 20:36:19 +1100 Current status: 0 (Normal) Standard output/error: ``` It works with smartctl 6.5 or 7.5 Can you provide a screenshot of the scheduled task's Task Settings tab. Like this one: <img width="530" height="586" alt="Image" src="https://github.com/user-attachments/assets/13657b17-5014-49e0-82bd-7a82650878b0" />
Author
Owner

@mikeletoh commented on GitHub (Jan 12, 2026):

Hi Dave,

I didn't get a header like you did in running the script. To recall, I don't get any emails at all and I have the exact same scripts tasked in three NAS Synologys. I managed to send out the output of the script to a saved folder. In running the script, it produces two text files. Examples include the files DS1019output and DS1019script. See attachments.

DS1019output.log

DS1019script.log

Attached file "Putty output DS1019" is a screenshot of the output from Putty. It also does not have a header.
I included a screenshot of the scheduled task's Task Settings tab for your review. This is named DS1019 Screenshot of sched ...

Image

I've also used your script syno_hdd_db.sh in my DS2422 so I wouldn't have to use Synology's own HDs. I don't even recall the script sending out an email but the program works.

Image

I know that my setup for email notifications work because I get emails whenever my UPS is down, SSL certificate has changed, a new DSM update was detected, I lose internet connection, etc. Perhaps I need to create a rule in my email notification setup so that I can receive emails from the scripts.

<!-- gh-comment-id:3740306066 --> @mikeletoh commented on GitHub (Jan 12, 2026): Hi Dave, I didn't get a header like you did in running the script. To recall, I don't get any emails at all and I have the exact same scripts tasked in three NAS Synologys. I managed to send out the output of the script to a saved folder. In running the script, it produces two text files. Examples include the files DS1019output and DS1019script. See attachments. [DS1019output.log](https://github.com/user-attachments/files/24572068/DS1019output.log) [DS1019script.log](https://github.com/user-attachments/files/24572070/DS1019script.log) Attached file "Putty output DS1019" is a screenshot of the output from Putty. It also does not have a header. I included a screenshot of the scheduled task's Task Settings tab for your review. This is named DS1019 Screenshot of sched ... ![Image](https://github.com/user-attachments/assets/d9a210a3-ca07-4838-8c20-1d18ea0a1889) I've also used your script syno_hdd_db.sh in my DS2422 so I wouldn't have to use Synology's own HDs. I don't even recall the script sending out an email but the program works. ![Image](https://github.com/user-attachments/assets/d4f41cf7-58f9-4e61-a379-73c7f2f2de97) I know that my setup for email notifications work because I get emails whenever my UPS is down, SSL certificate has changed, a new DSM update was detected, I lose internet connection, etc. Perhaps I need to create a rule in my email notification setup so that I can receive emails from the scripts.
Author
Owner

@007revad commented on GitHub (Jan 12, 2026):

It could be because you have not setup a recipient profile for your hotmail address.

  1. Go to "Control Panel > Notification > Email".
  2. Under "Recipient Profiles" click Add.
  3. Leave Rule set to Warning.
  4. Add your hotmail address.
<!-- gh-comment-id:3740416176 --> @007revad commented on GitHub (Jan 12, 2026): It could be because you have not setup a recipient profile for your hotmail address. 1. Go to "Control Panel > Notification > Email". 2. Under "Recipient Profiles" click Add. 3. Leave Rule set to Warning. 4. Add your hotmail address.
Author
Owner

@mikeletoh commented on GitHub (Jan 13, 2026):

Hi Dave,

I have an existing email address for my recipient profile for the All Rule. I added the same email for the profile for Warning, Critical, and default Rule just to make sure I have it covered. I also put a yahoo email address in the mix. Unfortunately, still no luck. I will let you know if I come up with a solution. Thank you though for all your help. I really appreciate it.

<!-- gh-comment-id:3741160614 --> @mikeletoh commented on GitHub (Jan 13, 2026): Hi Dave, I have an existing email address for my recipient profile for the All Rule. I added the same email for the profile for Warning, Critical, and default Rule just to make sure I have it covered. I also put a yahoo email address in the mix. Unfortunately, still no luck. I will let you know if I come up with a solution. Thank you though for all your help. I really appreciate it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_SMART_info#71
No description provided.