S.M.A.R.T. scheduling and smartd -q showtests.

Status
Not open for further replies.

panz

Guru
Joined
May 24, 2013
Messages
556
So, another of my stupid questions:

I noticed that if I schedule a short S.M.A.R.T. self-test to run, for example, at h 22 every day the output of the command

Code:
smartd -q shotests


tells me this

Code:
/dev/da0 [SAT], will do test 1 of type S at Sun Mar 23 22:13:08 2014 CET


see that? It says it will run at 22.13.08, just because I have saved the job at 23.13.08.
 
D

dlavigne

Guest
That's interesting.... What's the entry for the test in /etc/crontab?
 

panz

Guru
Joined
May 24, 2013
Messages
556
That's interesting.... What's the entry for the test in /etc/crontab?

This is my crontab (but I can't see any reference to what I'm searching...)

PHP:
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: src/etc/crontab,v 1.33.2.1 2009/08/03 08:13:06 kensmith Exp $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
#
#minute    hour    mday    month    wday    who    command
#
*/5    *    *    *    *    root    /usr/libexec/atrun
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11    *    *    *    *    operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0    *    *    *    *    root    newsyslog
#
# Perform daily/weekly/monthly maintenance.
1    3    *    *    *    root    periodic daily
15    4    *    *    6    root    periodic weekly
30    5    1    *    *    root    periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5    *    *    *    root    adjkerntz -a
 
0    *    *    *    *    root    /bin/sh /root/save_rrds.sh
 
0    *    *    *    *    root    /usr/local/bin/python /usr/local/bin/mfistatus.py > /dev/null 2>&1
*/5    *    *    *    *    root    /usr/local/bin/python /usr/local/www/freenasUI/tools/alert.py > /dev/null 2>&1
 
15    3    *    *    *    root    /usr/local/bin/python /usr/local/www/freenasUI/tools/cachetool.py expire >/dev/null 2>&1
30    3    *    *    *    root    /usr/local/bin/python /usr/local/www/freenasUI/tools/cachetool.py fill >/dev/null 2>&1
0    3    *    *    *    root    find /tmp/ -iname "sessionid*" -ctime +1d -delete
2    *    *    *    *    root    /etc/ix.rc.d/ix-kinit renew
00    23    *    *    *    root    PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" sh /mnt/storage/scripts/bkpconfig.sh > /dev/null
00    00    *    *    7    root    PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/local/sbin/scrub -t 35 storage
00    00    *    *    7    root    PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/local/sbin/scrub -t 35 backup
*    *    *    *    *    root    /usr/local/bin/python /usr/local/www/freenasUI/tools/autosnap.py > /dev/null 2>&1


Maybe because under Services --> S.M.A.R.T. the Check interval is set to 30 minutes?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Little schoolwork for you guys(and gals).

SMARTD and SMARTCTL do different things and don't really work together to get stuff done. The check interval being set to 30 minutes won't show up in crontab. That's handled internally by the smartd service, which you start with the little on/off switch in the WebGUI. Also any schedules you make to the

SMARTD is for monitoring and doing automated tests. It's test list is handled on its own and shouldn't show up in the crontab.

SMARTCTL lets you manually read the smart info from the disk and manually run tests. Many people choose to create scripts to run those tasks, and those would showup in crontab since crontab would handle execution of the script and therefore executing of the test.

To the OP: You didn't ask a question of any kind in your post.. so I have no idea what you are trying to figure out except to say "yep.. my system is running how it's supposed to".
 

panz

Guru
Joined
May 24, 2013
Messages
556
View attachment 3940
Little schoolwork for you guys(and gals).


To the OP: You didn't ask a question of any kind in your post.. so I have no idea what you are trying to figure out except to say "yep.. my system is running how it's supposed to".

Sorry for my usual difficulty in asking things correctly. My question is: how do I setup a S.M.A.R.T. test to run every day at 23:00 (exactly at 23:00)?

I can't get (or force) it to run at 23:00, because if I click ok on this button (see the screenshot) e.g. at 18:00 it will run at 23:00, but if I click OK at 18:15 it will run at 23:15.

Quite strange, isn't it?
Clipboard01.jpg
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Sounds like someone hasn't setup their date/time and timezone properly... ;)
 

panz

Guru
Joined
May 24, 2013
Messages
556
Sounds like someone hasn't setup their date/time and timezone properly... ;)

Try it!: it depends on the minute you click on the OK button!

If you click on the button at 21:01 it will run at 23:01; if you click at 21:02 it will run at 23:02 and so on...

BUT if you click at 21:30 it will run at 23:00!

I think it depends on the Check interval setting in the S.M.A.R.T. service dialog box (it refreshes every 30 minutes!!!)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Oh! I understand you now.. when you press the ok button, not the button for the minute.

Umm.. while I know what you mean now. I'm not sure what in particular you are concerned about. When running SMART test, you don't have the option of choosing a minute to run the test. The reason is that SMART tests are only guaranteed to be run on a particular hour. This is a smartd thing and not a FreeNAS thing from what I understand about it. I'm guessing what you are probably seeing is SMART reloading at the moment you press the OK button and at a multiple that causes you to see the test at different times. ;)

I'd bet if you reboot the server the test will run at a multiple if the minute that smartd starts and a multiple of your interval time.

So now that I've hopefully explained the behavior, do you think something is actually wrong or are you just noticing what you thought was a problem that is actually expected behavior?
 

panz

Guru
Joined
May 24, 2013
Messages
556
Thank you cyberjock, you explanation is very good and I will test it after a reboot. I was asking because I'm studying and being curious is a way to understand things! (so, today, I've studied smartd and I'm happy!).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You are probably one of a very small number of people that would have actually noticed that. LOL.
 
Status
Not open for further replies.
Top