Scripts to report SMART, ZPool and UPS status, HDD/CPU T°, HDD identification and backup the config

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
@jasonhalljax The last test age is the number of days since the last SMART test has been executed. If it is over the threshold set in the script then the warn symbol will be displayed.

So I'm not sure if something is wrong or not but can you post the email and the output of the SMART info for this disk so I can see if and what's wrong please?
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
@jasonhalljax The last test age is the number of days since the last SMART test has been executed. If it is over the threshold set in the script then the warn symbol will be displayed.

So I'm not sure if something is wrong or not but can you post the email and the output of the SMART info for this disk so I can see if and what's wrong please?
I'm having the same issue all of the sudden.
Code:
########## SMART status report summary for all drives ##########

+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+
|Device|Serial		 |Temp|Power|Start|Spin |ReAlloc|Current|Offline |UDMA  |Seek  |High  |Command|Last|
|	  |			   |	|On   |Stop |Retry|Sectors|Pending|Uncorrec|CRC   |Errors|Fly   |Timeout|Test|
|	  |			   |	|Hours|Count|Count|	   |Sectors|Sectors |Errors|	  |Writes|Count  |Age |
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+
|ada0  |WD-WCC4E2YZNDX7| 37 |20314|   32|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   6|
|ada1  |WD-WCC7K0XNAULA| 36 | 4153|	9|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   6|
|ada2 ?|WD-WCC4E5KJ3Y0L| 41 |20315|   32|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   7|
|ada3  |WD-WCC4E1EFA9E6| 40 |20314|   32|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   6|
|ada4  |WD-WCC4E6HZTD6X| 40 | 3207|   10|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   7|
|ada5  |WD-WCC4E7SD0Z2F| 40 |20315|   34|	0|	  0|	  0|	   0|	 0|   N/A|   N/A|	N/A|   7|
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+

Looks like smartd isn't running in my case.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Can you post the output of smartctl -a /dev/ada2 (between code tags) please?
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
So smartd wasn't running because I had enabled SMART on da0 and it was causing an error. Working again now.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Ok, perfect ;)
 

jasonhalljax

Cadet
Joined
Dec 17, 2017
Messages
5
@jasonhalljax The last test age is the number of days since the last SMART test has been executed. If it is over the threshold set in the script then the warn symbol will be displayed.

So I'm not sure if something is wrong or not but can you post the email and the output of the SMART info for this disk so I can see if and what's wrong please?

Sorry for the delay. Let me play around with things on my end and see if I can't get it working. Thanks for replying.
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
Hello,

just a question. Where I have to download the actual version of the script?
I want to use the smart report, the config backup and also the cpu temp scripts, all for the sata version.

Please can some one point me not the right direction?

Thanks a lot

Gesendet von meinem SM-N950F mit Tapatalk
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yes, pick what you want :)
 

jasonhalljax

Cadet
Joined
Dec 17, 2017
Messages
5
@jasonhalljax The last test age is the number of days since the last SMART test has been executed. If it is over the threshold set in the script then the warn symbol will be displayed.

So I'm not sure if something is wrong or not but can you post the email and the output of the SMART info for this disk so I can see if and what's wrong please?

Mine was also being caused by smart daemon not running. All is good now. Thanks.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Ok, perfect :)
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
I wanted to share my scripts because I think I'm not the only one who wants to monitor his FreeNAS server a bit more closely and in a more personalized way than the automatic nightly emails would do.
[...]

First of all, let me say THANKS for the great job you and the OPs have done with these scripts.
I just followed the first page post and everything seems to work perfectly.
Actually it made me discover my SMART service stopped working since 17days and i don't know why...(probably the last U1 update???)
the SMART service is stopped and i can't switch it on on the control services tab...
Code:
Feb  5 10:36:20 freenas daemon[3235]:	 2018/02/05 10:36:20 [WARN] agent: Check 'freenas_health' is now warning
Feb  5 10:36:46 freenas smartd[18558]: Unable to register device /dev/da0 (no Directive -d removable). Exiting

any ideas?

EDIT
found it

https://redmine.ixsystems.com/issues/27938
 
Last edited:

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
Hi all, with the email reports, i got another mail too

Code:
Failed conversion of ``1-on-Thu_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
			[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of ``1-on-Thu_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
			[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]


Does anybody know why? Is it related to the scripts or the system itself??
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
I wrote a short script to email me this information each night ...

kern.ostype: FreeBSD
kern.osrelease: 11.1-STABLE
kern.osrevision: 199506
kern.version: FreeBSD 11.1-STABLE #2 r321665+366f54a78b2(freenas/11.1-stable): Wed Mar 21 23:04:13 UTC 2018

This info is pulled from sysctl -a by various grep commands. I would like to add the latest update version (U4) but I can't seem to find that in the sysctl dump. Is this information available somewhere?
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I wrote a short script to email me this information each night ...

kern.ostype: FreeBSD
kern.osrelease: 11.1-STABLE
kern.osrevision: 199506
kern.version: FreeBSD 11.1-STABLE #2 r321665+366f54a78b2(freenas/11.1-stable): Wed Mar 21 23:04:13 UTC 2018

This info is pulled from sysctl -a by various grep commands. I would like to add the latest update version (U4) but I can't seem to find that in the sysctl dump. Is this information available somewhere?
You can pull the FreeNAS version from this text file on your system: \etc\version. Mine contains this text:
Code:
root@bandit:/etc # cat version
FreeNAS-11.1-U4 (89e3d93bc)
root@bandit:/etc #
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
thx Spearfoot ... that works.
 
Top