mirror of
https://github.com/007revad/Synology_SMART_info.git
synced 2026-04-24 23:55:48 +03:00
[GH-ISSUE #59] email output from Synology Task Scheduler #71
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Synology_SMART_info#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?
@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".

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.

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.

@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.
@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).

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.

@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
@007revad commented on GitHub (Jan 12, 2026):
You should get the exact same thing from task scheduler, but with a header like:
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:

@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 ...
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.
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.
@007revad commented on GitHub (Jan 12, 2026):
It could be because you have not setup a recipient profile for your hotmail address.
@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.