Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-26687

SMART plugin reports self_test_passed: FALSE while test is in progress

XMLWordPrintable

    • Sprint candidates

      When running a SMART self-test (smartctl -t), the Zabbix smart.disk.get plugin immediately reports self_test_passed:false during the test.
      This happens when on disks is SMART self-test — the JSON field .ata_smart_data.self_test.passed is not present while the test is running.

      Steps to reproduce:

       1. get new disk (never smart tested)

       2. check disk status in zabbix_agent2 smart plugin

      # /usr/sbin/zabbix_agent2 -c /etc/zabbix/inf/zabbix_agent2.conf -t smart.disk.get["/dev/sdb","sat"]
      
      smart.disk.get[/dev/sdb,sat]                  [s|{...,"self_test_passed":true,...}]
      

       3. check smarctl disk status:

      # smartctl -a /dev/sdb -j|jq '.ata_smart_data'
      
      {
        "offline_data_collection": {
          "status": {
            "value": 0,
            "string": "was never started"
          },
          "completion_seconds": 0
        },
        "self_test": {
          "status": {
            "value": 0,
            "string": "completed without error",
            "passed": true
          },
      

      4. run smart test

      # smartctl -t long /dev/sdb
      

      Result:
      Zabbix smart plugin reports self_test_passed: FALSE and make disk trigger

      # /usr/sbin/zabbix_agent2 -c /etc/zabbix/inf/zabbix_agent2.conf -t smart.disk.get["/dev/sdb","sat"]
      
      smart.disk.get[/dev/sdb,sat]                  [s|{...,"self_test_passed":false,"...}]
      

      The plugin incorrectly assumes the lack of passed - means test failed, even though it is just in progress.

      # smartctl -a /dev/sdb -j|jq '.ata_smart_data'
      {
        "offline_data_collection": {
          "status": {
            "value": 3,
            "string": "is in progress"
          },
          "completion_seconds": 120
        },
        "self_test": {
          "status": {
            "value": 249,
            "string": "in progress, 90% remaining",
            "remaining_percent": 90
          },
      

      Expected:
      While a SMART self-test is running, the plugin should report self_test_passed: null or self_test_passed: "in-progress" rather than false, because the SMART template trigger fires when the string "false" is detected.

      last(/_CF SMART by Zabbix agent 2 active/smart.disk.test[\{#NAME},\{#SN}])="false"

            zit Zabbix Integration Team
            GChmurka GChmurka
            Team INT
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: