S.M.A.R.T. Report

Status
Not open for further replies.

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
According to the manual, Section 6.4. the server will send a report if a S.M.A.R.T. test Fails. Does anyone know if there is a way to get it to e-mail a copy of the text whether it fails or passes?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yes, see the link "Useful scripts" in my signature ;)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
Wow... looks very helpful... only "problem" is I am fairly new to this and I am not sure how to implement the scrip. Where is this input?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
I'm not sure I understand the question. Can you explain in more details?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Copy it to a text file (use an .sh extension) on the server. Navigate to the directory it's in and run ./filename.sh
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
Sorry...

So your script looks to be too cool for words (the end result that is). But I am not sure of the first step of how to implement it. So, for example, assume I copy the script in to a text editor (note pad for example) then I put my e-mail in and correctly identify the drives (not sure yet how to get the correct names but I assume it is by looking at the GUI and clicking on Storage/View Disks and then see the name in my case ada0-ada5). Once I have all the info, then where do I put it. That was my question.
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
Copy it to a text file (use an .sh extension) on the server. Navigate to the directory it's in and run ./filename.sh

I am sorry, there is something I am missing in all of this. So I made the edits in a text file (notepad). Saved the file with a .sh extension (got the warning about changing its properties etc.).

Then I copied it in to a folder I have on the Free NAS server called "Documents" which is located at /mnt/Media/Documents (this I got from looking at Sharing and then the Windows CIFS tab for the Path).

What I assumed you were telling me to do was to navigate to that location in the Shell (which I did typing "cd /mnt/Media/Documents/" - which seemed to work as my root was then [root@freenas /mnt/Media/Documents]#) and then once there type: "run SMART.sh"

When I did that I got the following result:
"bash: run: command not found"
Same result when I typed "run ./SMART.sh"

What am I missing?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
You're close: Instead of typing run SMART.sh type ./SMART.sh to execute the script ;)

If you get a permission denied it's because the file isn't executable, just type chmod +x SMART.sh and then retry to execute the script.

Also, read the Scripts basics section of the Useful scripts thread to learn more about creating scripts :)
 
Joined
Jan 9, 2015
Messages
430
You don't need "run".

Nevermind....I was beat to the punch.:)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
You're close: Instead of typing run SMART.sh type ./SMART.sh to execute the script ;)

If you get a permission denied it's because the file isn't executable, just type chmod +x SMART.sh and then retry to execute the script.

Also, read the Scripts basics section of the Useful scripts thread to learn more about creating scripts :)

So that was long and involved... thanks for pointing to the Scripts basics section...

the paste function didn't work well and when I used ee SMART.sh it was all on one line so I manually went down each line of text till I came to a ^@ then hit enter and deleted the ^@. Which was good because the past didn't include everything (I had to do it in three chunks).

Anyway after all of that, I ran the script (had to change it to an executable as described above) and once I ran it I got the following results:

########## SMART status report summary for all drives ##########

+------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+
|Device|Serial |Temp|Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command|
| | | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout|
| | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count |
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+
|ada0 |WD-WCC4NJANZTZ8| 30 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
|ada1 |WD-WCC4NDZPHV7N| 31 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
|ada2 |WD-WMC4N0F3P1YZ| 32 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
|ada3 |WD-WCC4NEAUV8ND| 31 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
|ada4 |WD-WMC4N0F3APUY| 31 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
|ada5 |WD-WMC4N0F95M77| 33 | 808| 7| 0| 0| 0| 0| N/A| N/A| N/A| N/A|
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+



########## SMART status report for ada0 drive (Western Digital Red: WD-WCC4NJANZTZ8) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 178 178 021 Pre-fail Always - 6083
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 15
194 Temperature_Celsius 0x0022 120 119 000 Old_age Always - 30
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -



########## SMART status report for ada1 drive (Western Digital Red: WD-WCC4NDZPHV7N) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 180 180 021 Pre-fail Always - 5983
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 15
194 Temperature_Celsius 0x0022 119 119 000 Old_age Always - 31
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -



########## SMART status report for ada2 drive (Western Digital Red: WD-WMC4N0F3P1YZ) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 179 179 021 Pre-fail Always - 6050
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 2
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 16
194 Temperature_Celsius 0x0022 118 117 000 Old_age Always - 32
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -



########## SMART status report for ada3 drive (Western Digital Red: WD-WCC4NEAUV8ND) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 179 179 021 Pre-fail Always - 6033
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 17
194 Temperature_Celsius 0x0022 119 118 000 Old_age Always - 31
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -



########## SMART status report for ada4 drive (Western Digital Red: WD-WMC4N0F3APUY) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 179 179 021 Pre-fail Always - 6016
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 2
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 16
194 Temperature_Celsius 0x0022 119 118 000 Old_age Always - 31
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -



########## SMART status report for ada5 drive (Western Digital Red: WD-WMC4N0F95M77) ##########

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 177 176 021 Pre-fail Always - 6150
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 7
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 808
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 17
194 Temperature_Celsius 0x0022 117 115 000 Old_age Always - 33
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

No Errors Logged

Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Short offline Completed without error 00% 735 -
[\SPOILER]

So YES! It looks like it works... now I assume it does this automatically every time a scheduled SMART test runs right?

So I love the scripts... and want to implement more but I am going to have to understand how to do this editing as I was worried I might miss something having to do it the way I did... Anyway extra data is for those who are new and may be running into the same problems as me...
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
I'm glad it worked ;)

The line problem is because of the difference of the line breaking character between windows and unix systems (\n for unix and \r\n for windows). To avoid that you can copy-paste directly from the pastebin to the editor in the shell (again, see the scripts basics, everything should be here) ;)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
So I must have done something wrong somewhere. I was expecting a report to be e-mailed to me but I have yet to receive one. So I ran the report manually and the script still works (I just got the report) but it doesn't seem to run after each Short and Long test. So my question is what did I do wrong? A separate unrelated question relates to the old DOS command "Dir" is there an equivalent for FreeNAS? I didn't realize till now that the file names are case sensitive so when I first tried to run the scrip using lower case letters it acted like it didn't exist and I almost made the script all over again. Anyway it would have helped if I could have just seen what was in that directory (and the "dirs" command seems to be for a different function altogether.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
So I must have done something wrong somewhere. I was expecting a report to be e-mailed to me but I have yet to receive one. So I ran the report manually and the script still works (I just got the report) but it doesn't seem to run after each Short and Long test. So my question is what did I do wrong? A separate unrelated question relates to the old DOS command "Dir" is there an equivalent for FreeNAS? I didn't realize till now that the file names are case sensitive so when I first tried to run the scrip using lower case letters it acted like it didn't exist and I almost made the script all over again. Anyway it would have helped if I could have just seen what was in that directory (and the "dirs" command seems to be for a different function altogether.
The Unix equivalent of DIR is ls. The one closest to default DIR is ls -l.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
You need to add a CRON task that execute the script when you want (logically a few hours after the SMART tests, maybe more than that if it's a long test...), I don't know if you did it but it can be that :)

The equivalent to dir is ls (and ls -l if you want a clearer list) ;)

Yep, everything is case sensitive on Linux and FreeBSD based systems.
 
Joined
Jan 9, 2015
Messages
430
Have to set the script up to run as a cron task? The script only emails you each time you run it, not after each short or long test.
 
Joined
Jan 9, 2015
Messages
430
Wow, all three of us answering at one time. :)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
So the command I would run is it the "./SMART.sh" or do I need to do something else for the cron job?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
You need to use the absolute path. Where did you place the script? If you're not sure go where the script is and do a pwd to see the path ;)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
That worked! Thanks for the pwd command
 
Status
Not open for further replies.
Top