[Solved] cron job parameters for "Run SMART Test (short)"

Started by IsaacFL, July 18, 2021, 12:11:30 AM

Previous topic - Next topic
Has anybody gotten the system/settings/cron job to Run SMART Test to work?

I was wondering if there were any parameters required?  I have an ada0 and cd0 and I think that the cd0 is making the test not run correctly, but not sure.

Is there a log somewhere for it?

This is the error I get if I run with no parameters:
021-07-17T23:21:00 configd.py[45902] [cb52e7cc-d7a2-4c33-8088-465b0c0ddcff] Script action failed with Command '/usr/local/sbin/smartctl -t short' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 479, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/sbin/smartctl -t short' returned non-zero exit status 1.
2021-07-17T23:21:00 configd.py[45902] [cb52e7cc-d7a2-4c33-8088-465b0c0ddcff] Testing device (short)




I think I figured it out. 

It appears that you have to add the device to test in the parameters. In my case: "/dev/ada0"

The cron job executes /usr/local/sbin/smartctl -t short' so need the device added to the parameters.


The next thing would be nice to fix is that the widget shows the cd0 as "unknown" but also fills the logs with:

Jul 18 09:34:07 OPNsense.mydomain.com devd Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="KZFJ1AA5944" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 01" CDB="25 00 00 00 00 00 00 00 00 00 " '
Jul 18 09:37:09 OPNsense.mydomain.com devd Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="KZFJ1AA5944" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 01" CDB="25 00 00 00 00 00 00 00 00 00 " '
Jul 18 09:37:29 OPNsense.mydomain.com devd Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="KZFJ1AA5944" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 01" CDB="25 00 00 00 00 00 00 00 00 00 " '
Jul 18 09:39:11 OPNsense.mydomain.com devd Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="KZFJ1AA5944" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 01" CDB="25 00 00 00 00 00 00 00 00 00 " '