[ZBX-22770] S.M.A.R.T false positive self test value when tests are running Created: 2023 May 06  Updated: 2025 Apr 28

Status: Ready for QA
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G), Templates (T)
Affects Version/s: None
Fix Version/s: 7.0.13rc1, 7.2.7rc1, 7.4.0rc1 (master)

Type: Problem report Priority: Critical
Reporter: Jonas L Assignee: Nikita Gogolevs
Resolution: Unresolved Votes: 16
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-05-06-14-08-16-938.png     PNG File image-2023-05-06-14-08-42-590.png     PNG File image-2023-05-06-14-10-17-252.png    
Issue Links:
Related
related to ZBXNEXT-9926 Template changes for smart self test Ready for QA
Team: Team INT
Story Points: 1.5

 Description   

Steps to reproduce:

  1. Set up a SMART monitoring template
  2. Start a self test on a disk using smartctl or a scheduled one configured in the smartd config
  3. See the trigger "Disk self-test is not passed" being raised

Result:

**

Expected:
I expect the SMART monitoring plugin to monitor if a self test is currently running, and extend the "Disk self-test is not passed" trigger not to raise if a test is currently running.

Here is the output of a completed self test on a different disk:



 Comments   
Comment by Jonas L [ 2023 May 06 ]

This code from smartmontools might give some useful ideas on how to use the `.ata_smart_data.self_test.status.value` field.

 

https://github.com/smartmontools/smartmontools/blob/292ef306a92b5764da06388c91d68485b80d81d2/smartmontools/ataprint.cpp#L885-L980

Comment by Alexey [ 2023 Jul 26 ]

same problem

Comment by zabbit [ 2023 Nov 02 ]

I can confirm that this issue is triggered by any SMART test being in progress - including selective offline range scans, not just the ordinary long, short and conveyance scans.

Comment by nknk [ 2023 Nov 24 ]

same problem, is this on the roadmap?

Comment by Pavel [ 2023 Nov 28 ]

This is an important problem and almost always occurs with magnetic disks.

Comment by zabbit [ 2023 Dec 18 ]

In src/go/plugins/smart/smart.go, should the setSelfTest(...) maybe return nil while a test is in progress as it does for disks where tests are not supported at all? Or should the test running status be exposed all the way out to the Zabbix level and the Item+Trigger code take it into account?

So either handle case 15 from the smartmontools code linked by Jonas above or export the running status and do something along the lines of

last(/server/smart.disk.test[thingy])="false" and last(/server/smart.disk.test_running[thingy])="false"

in the trigger?

 

I don't think we can get the result of the last test while the current one is running easily?

Comment by Pavel [ 2024 May 26 ]

Any news? Was the problem more complicated?

Comment by Pavel [ 2024 Dec 06 ]

I thought I'd share how I'm forced to solve this problem.
I just use a wrapper script around smartctl - https://github.com/pavlozt/somezabbixtemplates/tree/master/workarounds/smart-test

Among other things, you need to configure the agent (/etc/zabbix/zabbix_agent2.d/plugins.d):

Plugins.Smart.Path=/usr/local/sbin/smartctlwrapper
Plugins.Smart.Timeout = 20
Generated at Fri May 02 07:16:00 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.