Ad Widget

Collapse

SMART by Zabbix agent 2 Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gomo
    Junior Member
    • May 2024
    • 16

    #16
    Originally posted by mdella

    So whats happening there is that the "zabbix" user is trying to execute the smartctl command which is a root privledged command only. The above suggestion from Markku should work for you on your machine. Typically what this means is that your zabbix system was not granted access to the /dev/sd? devices application. If his example does *not* work, then the problem is going to be in your /etc/sudoers file (either there is a hidden typo, located in the wrong order, etc.

    Additionally, I see you used the "@includedir" function. If your sudo is 1.9.1 or earlier, that wont work and would need to be the original "#includedir" to get your zabbix entry.

    Lastly, you have "two" zabbix entries, one in the include dir and one at the end of your /etc/sudoers file. You have to eliminate one of those or you have a conflict.

    Marcos
    Here's the output:
    Click image for larger version

Name:	image.png
Views:	607
Size:	12.3 KB
ID:	485271
    As for the two zabbix entries, the one which was getting included via "@includedir" was removed soon after it was made.

    I made sure all the formatting & potential double-spaces are removed from "zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl" entry in "visudo" but nothing is changing.
    I am really not doing anything out of the ordinary here and it's quite frustrating that this template isn't working. There's too little variables to make a mistake on (compared to some other setup-ups) and yet it doesn't work :/

    Comment

    • claros
      Junior Member
      • Jun 2024
      • 6

      #17
      Hi!
      I've the same issue and it's a problem due to the agent, as i can see into the debug log:

      Code:
      2024/06/12 13:22:03.171027 executing direct exporter task for key 'smart.disk.get[/dev/sda,"sat"]'
      2024/06/12 13:22:03.292854 executed direct exporter task for key 'smart.disk.get[[/dev/sda sat]]'
      2024/06/12 13:22:03.292931 sending passive check response: '{"version":"7.0.0","variant":2,"data":[{"value":"{\"calibration_retry_count\":{\"
      value\":0,\"raw\":\"0\"},\"critical_warning\":0,\" current_pending_sector\":{\"value\":0,\"raw\":\"0\ "},\"disk_type\":\"hdd\",\"error\":\"\",\
      "exit_status\":24,\"firmware_version\":\"05.01A05\ ",\"head_flying_hours\":{\"value\":8743,\"raw\":\" 8743\"},\"load_cycle_count\":{\"value\":8
      4381,\"raw\":\"84381\"},\"media_errors\":0,\"model _name\":\"WDC WD5000LPLX-08ZNTT0\",\"multi_zone_error_rate\":{\"value\":0,\ "raw\":\"0\"},\"
      offline_uncorrectable\":{\"value\":0,\"raw\":\"0\" },\"percentage_used\":0,\"power-off_retract_count\":{\"value\":37,\"raw\":\"37\"}, \"power_c
      ycle_count\":{\"value\":849,\"raw\":\"849\"},\"pow er_on_hours\":{\"value\":8857,\"raw\":\"8857\"},\" power_on_time\":8857,\"raw_read_error_rat
      e\":{\"value\":0,\"raw\":\"0\"},\"reallocated_even t_count\":{\"value\":38,\"raw\":\"38\"},\"realloca ted_sector_ct\":{\"value\":2641,\"raw\":\
      "2641\"},\"seek_error_rate\":{\"value\":1,\"raw\": \"1\"},\"self_test_passed\":true,\"serial_number\" :\"WD-XXXXXXXXXXX\",\"spin_retry_count\"
      :{\"value\":0,\"raw\":\"0\"},\"spin_up_time\":{\"v alue\":1541,\"raw\":\"1541\"},\"start_stop_count\" :{\"value\":3176,\"raw\":\"3176\"},\"temperature\" :33,\"temperature_celsius\":{\"value\":33,\"raw\": \"33\"},\"udma_crc_error_count\":{\"value\":0,\"ra w\":\"0\"}}"}]}' to '[I]xx.xx.xx.xx[/I]
      So I' think the problem is related to the proxy/server


      Comment

      • Gomo
        Junior Member
        • May 2024
        • 16

        #18
        Originally posted by claros
        Hi!
        I've the same issue and it's a problem due to the agent, as i can see into the debug log:

        Code:
        2024/06/12 13:22:03.171027 executing direct exporter task for key 'smart.disk.get[/dev/sda,"sat"]'
        2024/06/12 13:22:03.292854 executed direct exporter task for key 'smart.disk.get[[/dev/sda sat]]'
        2024/06/12 13:22:03.292931 sending passive check response: '{"version":"7.0.0","variant":2,"data":[{"value":"{\"calibration_retry_count\":{\"
        value\":0,\"raw\":\"0\"},\"critical_warning\":0,\" current_pending_sector\":{\"value\":0,\"raw\":\"0\ "},\"disk_type\":\"hdd\",\"error\":\"\",\
        "exit_status\":24,\"firmware_version\":\"05.01A05\ ",\"head_flying_hours\":{\"value\":8743,\"raw\":\" 8743\"},\"load_cycle_count\":{\"value\":8
        4381,\"raw\":\"84381\"},\"media_errors\":0,\"model _name\":\"WDC WD5000LPLX-08ZNTT0\",\"multi_zone_error_rate\":{\"value\":0,\ "raw\":\"0\"},\"
        offline_uncorrectable\":{\"value\":0,\"raw\":\"0\" },\"percentage_used\":0,\"power-off_retract_count\":{\"value\":37,\"raw\":\"37\"}, \"power_c
        ycle_count\":{\"value\":849,\"raw\":\"849\"},\"pow er_on_hours\":{\"value\":8857,\"raw\":\"8857\"},\" power_on_time\":8857,\"raw_read_error_rat
        e\":{\"value\":0,\"raw\":\"0\"},\"reallocated_even t_count\":{\"value\":38,\"raw\":\"38\"},\"realloca ted_sector_ct\":{\"value\":2641,\"raw\":\
        "2641\"},\"seek_error_rate\":{\"value\":1,\"raw\": \"1\"},\"self_test_passed\":true,\"serial_number\" :\"WD-XXXXXXXXXXX\",\"spin_retry_count\"
        :{\"value\":0,\"raw\":\"0\"},\"spin_up_time\":{\"v alue\":1541,\"raw\":\"1541\"},\"start_stop_count\" :{\"value\":3176,\"raw\":\"3176\"},\"temperature\" :33,\"temperature_celsius\":{\"value\":33,\"raw\": \"33\"},\"udma_crc_error_count\":{\"value\":0,\"ra w\":\"0\"}}"}]}' to '[I]xx.xx.xx.xx[/I]
        So I' think the problem is related to the proxy/server

        What do you mean the issue is related to the "proxy/server" ?

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #19
          Gomo maybe you could increase the agent logging as well and see what you get in the agent log when attempting?

          Markku

          Comment

          • Gomo
            Junior Member
            • May 2024
            • 16

            #20
            Exact same problem is documented here https://support.zabbix.com/browse/ZB...lugin%20(N)%22
            I am really wondering how everyone is unaware / unaffected by this.

            Unfortunately, following the suggested workaround in post mentioned above, leads to another error: "Cannot fetch data.: failed to scan for devices: Cannot unmarshal JSON.: invalid character '/' looking for beginning of value."

            Comment

            • mario_rossi
              Junior Member
              • Jun 2024
              • 15

              #21
              Hi, my template "SMART by Zabbix agent 2" is empty, without any items set by default. Can you help me understand how I can get the template with all the information?
              Click image for larger version

Name:	image.png
Views:	594
Size:	4.5 KB
ID:	486504

              Comment

              • Markku
                Senior Member
                Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                • Sep 2018
                • 1781

                #22
                The template is not empty, it has a discovery rule that will create the items.

                Markku

                Comment

                • mario_rossi
                  Junior Member
                  • Jun 2024
                  • 15

                  #23
                  Thanks for your help, I'm new to using this template, please help me solve my problem.

                  I am using the SMART template in Zabbix connected to a virtual machine with a 64-bit Windows 10 operating system.
                  I have installed and configured the Zabbix 2 agent and everything works correctly, without problems, however when I connect the "SMART by Zabbix agent 2" template the data is not transmitted and therefore I cannot carry out monitoring.
                  Click image for larger version

Name:	image.png
Views:	582
Size:	19.2 KB
ID:	486669​​I installed the "smartmontools" program on the Windows VM but even with this it does not seem to detect data. If I run the command "smartctl.exe -a /dev/sda" in cmd I can see all the data on the physical disk correctly.
                  Click image for larger version

Name:	image.png
Views:	526
Size:	131.6 KB
ID:	486670
                  I also saw this guide https://www.zabbix.com/forum/zabbix-...hdd-smart-data and I tried to perform these steps but without success, I always get an error

                  ​​

                  Comment

                  • claros
                    Junior Member
                    • Jun 2024
                    • 6

                    #24
                    Originally posted by Gomo

                    What do you mean the issue is related to the "proxy/server" ?
                    The agent itself read the data, but the proxy is unable to get/understand it. It's just a guess of mine anyway...

                    Comment


                    • mario_rossi
                      mario_rossi commented
                      Editing a comment
                      Hi, thanks for your suggestion. I solved this problem in another case
                  Working...