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

Zabbix Agent 2 - SMART plugin - Incorrect type of disk in LLD for unknown HDD


    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Major Major
    • 5.0.18
    • Agent2 plugin (N)
    • Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022)
    • 0.5


      Have a problem with plugin SMART for Zabbix Agent 2.

      Zabbix in LLD key - "smart.disk.discovery", in LLD macro {#DISKTYPE} - instead of HDD, outputs SSD. In this case by default, the disc type is inserted into the application what will be misleading.

      Steps to reproduce:

      1. Install Zabbix Agent 2 via apt from official repo.
      2. Install smartmontools, sudo via apt from Debian packages.
      3. nano /etc/sudoers
      4. Insert access - "zabbix  ALL=(root) NOPASSWD: /usr/sbin/smartctl"
      5. nano /etc/zabbix/zabbix_agent2.conf
      6. Insert path to smartmontools - "Plugins.Smart.Path=/usr/sbin/smartctl"
      7. service zabbix-agent2 restart
      8. In frontend, import official template (https://www.zabbix.com/ru/integrations/smart)
      9. Connect template to host.
      10. Wait LLD or Check now LLD or Test LLD


      Wrong disk type (in attachments - smart.disk.discovery - problem.json)


      This disk should have been output as an HDD disk.

      This problem manifests itself in both Linux and Windows systems.


      {{/usr/sbin/update-smart-drivedb - }}this command did not help.

      If you make a data request via Zabbix for JSON data, you can see that the disk is detected, but the "disk_type" is "unknown" (in attachments - smart.disk.get - problem.json). And there is no "rotation_rate" parameter in JSON. In the plugin code, it is this parameter that determines whether it is an HDD or SSD, and if this is an unknown type of disk, then SSD will always be detected, which I think is incorrect (in attachments - smart-zbx.png, https://github.com/zabbix/zabbix/blob/65f08dbeaf9b49c41026ec2e6aa3f2fe44a45685/src/go/plugins/smart/smart.go#L205)

      Checked on other machines where SSD is installed, there will always parameter "disk_type" will be SSD (in attachments - smart.disk.get - ok.json).


      If it really is a problem, then I will gladly wait for a solution to the problem. If additional information is needed, I am ready to try to provide.
      Thank you!

            esneiders Eriks Sneiders
            MaxSH97 Maksim Strekalovskikh
            Team INT
            0 Vote for this issue
            6 Start watching this issue