No Threshold Days for SMART Test?

Status
Not open for further replies.

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
Is there some reason we don't get to set threshold days for SMART tests, only for scrubs?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
I mean is there a reason the GUI doesn't allow setting threshold days for SMART tests? I presume that it's not there for a reason.

QbHe9Ru.png


versus

C0HcX2W.png
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
is this available for SMART? I'm not sure.. Within the GUI you can be pretty specific when you want the tests to occur.. I found the threshold for scrubs confusing at first..
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
is this available for SMART? I'm not sure.. Within the GUI you can be pretty specific when you want the tests to occur.. I found the threshold for scrubs confusing at first..
It's not available for SMART. I'm asking why.

There are also no options for choosing minutes for SMART tests as there are for scrubs. It seems like an omission rather than intentional design.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
It's probably not nescessary for SMART.. Whereas ZFS scrubs you may want some more flexibility depending on schedules..
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
It's probably not nescessary for SMART.. Whereas ZFS scrubs you may want some more flexibility depending on schedules..
I can't think of a reason why someone wouldn't want the same flexibility with SMART.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
You could look and request it on bugs.freenas .org if its not a dupe request..

Sent from my SGH-I257M using Tapatalk 2
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The actual place to ask it is from the smartmontools people. They're the ones that would have to add it to their project first.

To be honest, there's no 'good way' to handle a threshold. The reason for that is that zfs works on a single schedule, the typical 24 hour clock.

Hard drives don't. They work on "power-on" hours. Granted if you keep the system on 24x7 you could make some assumptions. If you are at 100 hours power-on at midnight on sunday night, then at midnight on monday night assuming you didn't turn off the server then it should be 124. But if you are at 100 hours and shutdown your server for a week, when you power it back on it will still be at 100 hours. Do you really want to add a week between tests just because you did a shutdown while you were out of town.

Now you might argue that you don't want that, and by having the schedule as FreeNAS (and the smartmontools project does it) means if you do a long test every sunday at noon and you shutdown your server monday morning and go out of town until saturday, then powerup your system you'll do another test the following day. To the SMART logs on your disk you will appear to have done two long tests within 24 hours. But that's definitely not what happened.

Based on all of this I'd expect the smartmontools to say that it's not desirable, but put the ticket in and let them make that call. ;)

Optionally you could write a bash script to parse the disk info and run it at desired intervals yourself. :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Edit: D'oh, didn't get the customary "new messages" warning
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
The actual place to ask it is from the smartmontools people. They're the ones that would have to add it to their project first.
Smartmontools people write the FreeNAS GUI for scheduling SMART tests? I thought it was just a cron job.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You are correct, it's just a cronjob. But the user is talking about having thresholds added. That would mean telling smartmontools, when it's run, to obey some threshold. Then when smartmontools would run it would look at the disk's SMART attributes would recognize you didn't want to do the SMART test based on the relationship between power-on hours on the disk and when the last test was performed and then not do the test.

Everything would be handled by smartmontools. There's no way to do that by cronjob except to make your own script that would obey your expectations.
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
You are correct, it's just a cronjob. But the user is talking about having thresholds added. That would mean telling smartmontools, when it's run, to obey some threshold.
Cron just executes smartmontool on schedule. There's nothing to communicate to smartmontools except which devices to test. A threshold is a scheduling mechanism, which is cron's domain. All that's required is to limit execution of smartmontools to x days apart. Something like:

0 3 */2 * *
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Cron just executes smartmontool on schedule. There's nothing to communicate to smartmontools except which devices to test. A threshold is a scheduling mechanism, which is cron's domain. All that's required is to limit execution of smartmontools to x days apart. Something like:

0 3 */2 * *

That's precisely what I said above in my first post. I also tried to explain why the threshold isn't as "important" as people might think it is. I also tried to explain why the "threshold" and "power-on" isn't quite the same so the theory behind why one has a threshold and one has power-on isn't the same. ;)

Now in my theoretical "how to implement the threshold" you'd add a parameter to the cronjob itself that would tell smartmontools what the 'threshold' would be. Then it would check with the disk's info and make that call. Or, you code your own script to do all this and then simply run that script as a cronjob.
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
That's precisely what I said above in my first post.

My apologies if I got it wrong. I thought you were trying to say that the best way to schedule SMART tests was to have the smartmontools folks add scheduled automated testing capabilities to their software package.

I also tried to explain why the threshold isn't as "important" as people might think it is.

It's important if you want to schedule SMART testing every two weeks.

I also tried to explain why the "threshold" and "power-on" isn't quite the same so the theory behind why one has a threshold and one has power-on isn't the same. ;)

I'm not sure what relationship "power-on" time has to cron scheduling.

Now in my theoretical "how to implement the threshold" you'd add a parameter to the cronjob itself that would tell smartmontools what the 'threshold' would be. Then it would check with the disk's info and make that call. Or, you code your own script to do all this and then simply run that script as a cronjob.

That sounds more like trying to schedule a test based on the amount of time a disk has been spinning. That's independent and unrelated to a threshold number of days between tests.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
My apologies if I got it wrong. I thought you were trying to say that the best way to schedule SMART tests was to have the smartmontools folks add scheduled automated testing capabilities to their software package.

Nope. I was saying they'd need to add the logic for the "threshold" function.

I'm not sure what relationship "power-on" time has to cron scheduling.

And that's precisely my point. 24 hours that are "power-on" hours do not have to equal 24 hours of real-world time. Read my "example" where you can have a disparity between power-on hours and 24 hours of real-world time. ;)

That sounds more like trying to schedule a test based on the amount of time a disk has been spinning. That's independent and unrelated to a threshold number of days between tests.

There's only two ways to schedule a test based on a timeframe (in theory). Power-on hours and real-world hours. Real-world hours are already covered by the cronjob. Power-on hours are not covered by anything because they are not particularly important for SMART tests (this is the feature that is being requested with thresholds).

Technically most good practices call for monthly SMART tests for hard drives sitting on a shelf was cold-spares for a server. But I can bet that most of us don't do that (I sure as heck don't).
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
FreeNASBob, I think the piece that's being missed here is that the "threshold" is a function of the ZFS scrub command, not of cron. If you set up a ZFS scrub with a threshold of 35 days, and set it to every day, cron will call the scrub every day. The scrub will see that it's been less than 35 days and terminate without actually running the scrub. You can confirm this by looking in /etc/crontab and seeing how the scrub is called.

The SMART tools have no such feature, and it wouldn't be possible to directly implement anyway, which is what cyberjock is saying.
 

titan_rw

Guru
Joined
Sep 1, 2012
Messages
586
Maybe I'm wrong, and even if I'm right, maybe I'm nit-picking, but cron doesn't handle scheduled smart tests.

The schedules you set in the smart test section get defined in smartd.conf, along with other configuration options. This is then used by smartd, which is loaded by a system init script.

My drives looks like this:

Code:
/dev/ada2 -a -n never -W 5,35,45 -m my@email.com -s L/(01|02|03|04|05|06|07|08|09|10|11|12)/(07|21)/(1|2|3|4|5|6|7)/(02) -a -M daily -R 5! -R 10! -R 187! -R 188! -R 189! -R 197! -R 198! -R 199!


The -s part reads "every month (01-12), on days of the month (07,21), every day of the week (1-7), at 2am (02).

I also add extra smart attributes I'd like to be notified about over and above the defaults. I also want to be notified daily on 'problems', and not just once.

This file is then read by smartd, which actually executes the tests.

I think you'd have to ask the smartmontools people if you wanted a threshold implemented. I really don't see the need.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Doh, you're right titan_rw. Thanks for correcting me. As I was typing that I was questioning if that was right but didn't have time to go back and check at that time.

I think you'd have to ask the smartmontools people if you wanted a threshold implemented. I really don't see the need.

And that's pretty much what my first post said. I was trying to be more polite about it when I said:

Based on all of this I'd expect the smartmontools to say that it's not desirable, but put the ticket in and let them make that call. ;)
 
Status
Not open for further replies.
Top