Ad Widget

Collapse

Zabbix Agent2 on Windows can't get hdd smart data.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akong77
    Junior Member
    • Oct 2018
    • 21

    #1

    Zabbix Agent2 on Windows can't get hdd smart data.

    Hello,
    I have installed zabbix agent2 on windows server and setup smartctl done.One windows smart data always show no data on zabbix server.
    I test command on windows.
    zabbix_agent2 -t smart.disk.get
    It's got message like follow
    smart.disk.get [s|[]]
    I don't know what is mean.I have test another windows server.It's will get more information.How to fix it?
  • vladimir_lv
    Senior Member
    • May 2022
    • 240

    #2
    Hi!
    You have to install smartmontools and then add the line to C:\Program Files\Zabbix Agent 2\zabbix_agent2.d\plugins.d\smart.conf
    Code:
     Plugins.Smart.Path="C:\Program Files\smartmontools\bin\smartctl.exe"
    Restart agent.
    The command zabbix_agent2 -t smart.disk.get still shows an error but if you use the template SMART by Zabbix agent 2 or SMART by Zabbix agent 2 active, everything will work fine

    Comment

    • akong77
      Junior Member
      • Oct 2018
      • 21

      #3
      Yes,I has installed smartmontools and add the line to C:\Program Files\Zabbix Agent 2\zabbix_agent2.d\plugins.d\smart.conf

      Click image for larger version

Name:	圖片.png
Views:	2799
Size:	43.4 KB
ID:	449073

      Click image for larger version

Name:	圖片.png
Views:	2800
Size:	13.4 KB
ID:	449074

      I don't know what is this problem.I has restart zabbix agent2.I have another windows machine.It's the same settings.It's all ok.

      Comment

      • vladimir_lv
        Senior Member
        • May 2022
        • 240

        #4
        Ups... I am stupid, of course, you need to use your config file:
        Code:
        zabbix_agent2 -c "C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf" -t smart.disk.get

        Comment

        • akong77
          Junior Member
          • Oct 2018
          • 21

          #5
          I test it.

          Click image for larger version

Name:	圖片.png
Views:	2800
Size:	4.4 KB
ID:	449079

          It's the same error.

          Comment

          • vladimir_lv
            Senior Member
            • May 2022
            • 240

            #6
            But you get output from the command?
            Code:
            smartctl.exe -a /dev/sda

            Comment

            • akong77
              Junior Member
              • Oct 2018
              • 21

              #7
              It's have harddisk information.

              Click image for larger version

Name:	圖片.png
Views:	2768
Size:	25.0 KB
ID:	449084

              Comment

              • markosa
                Senior Member
                Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                • Aug 2022
                • 104

                #8
                Does Zabbix agent have sufficient rights to run smartctl ? I can see that you are running that cmd with admin rights... Any errors related to agent/smartctl in Windows events?

                Comment

                • akong77
                  Junior Member
                  • Oct 2018
                  • 21

                  #9
                  I run
                  zabbix_agent2 -c "C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf" -t smart.disk.get
                  this command is use admin permission.

                  Comment

                  • dimir
                    Zabbix developer
                    • Apr 2011
                    • 1080

                    #10
                    Could you enable logging (DebugLevel=5), run zabbix_agent2 again and attach the log output?

                    Comment

                    • akong77
                      Junior Member
                      • Oct 2018
                      • 21

                      #11
                      OK,I try it.

                      Comment

                      • akong77
                        Junior Member
                        • Oct 2018
                        • 21

                        #12
                        I have two windows server.One is Intel cpu and zabbix agent2 can get it.Can't get data is amd cpu.Is this question?

                        Comment

                        • akong77
                          Junior Member
                          • Oct 2018
                          • 21

                          #13
                          I attach my log file.Please check it.Thanks a lot.
                          Because upload file size limit.So I compress to zip file.
                          Attached Files

                          Comment


                          • vladimir_lv
                            vladimir_lv commented
                            Editing a comment
                            I see the requests and answers for 'smart.disk.discovery' only. Could you run zabbix_agent2 -c "C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf" -t smart.disk.get and attach the log once again?
                        • akong77
                          Junior Member
                          • Oct 2018
                          • 21

                          #14
                          Hello,
                          First I clean the log and restart zabbix agent2.Then I run this command.But it's only show zabbix agent start log.

                          2022/08/03 13:58:19.410101 Starting Zabbix Agent 2 (6.0.7)
                          2022/08/03 13:58:19.421426 OpenSSL library (OpenSSL 1.1.1k 25 Mar 2021) initialized
                          2022/08/03 13:58:19.421947 default context ciphersuites: TLS_CHACHA20_POLY1305_SHA256 TLS_AES_128_GCM_SHA256 ECDHE-PSK-AES128-CBC-SHA256 ECDHE-PSK-AES128-CBC-SHA PSK-AES128-GCM-SHA256 PSK-AES128-CCM8 PSK-AES128-CCM PSK-AES128-CBC-SHA256 PSK-AES128-CBC-SHA
                          2022/08/03 13:58:19.421947 psk context ciphersuites: TLS_CHACHA20_POLY1305_SHA256 TLS_AES_128_GCM_SHA256 ECDHE-PSK-AES128-CBC-SHA256 ECDHE-PSK-AES128-CBC-SHA PSK-AES128-GCM-SHA256 PSK-AES128-CCM8 PSK-AES128-CCM PSK-AES128-CBC-SHA256 PSK-AES128-CBC-SHA
                          2022/08/03 13:58:19.422459 using configuration file: C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf
                          2022/08/03 13:58:19.422459 using plugin 'Agent' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.422459 using plugin 'Ceph' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422459 using plugin 'Cpu' (built-in) providing following interfaces: exporter, collector, runner
                          2022/08/03 13:58:19.422459 using plugin 'DNS' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.422980 using plugin 'File' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Log' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.422980 using plugin 'MQTT' (built-in) providing following interfaces: watcher, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Memcached' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Memory' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.422980 using plugin 'Modbus' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Mysql' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422980 using plugin 'NetIf' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.422980 using plugin 'Oracle' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Postgres' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Proc' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.422980 using plugin 'Redis' (built-in) providing following interfaces: exporter, runner, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Smart' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.422980 using plugin 'Swap' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'SystemRun' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'TCP' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'UDP' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'Uname' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'Uptime' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'Users' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'VFSDir' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'VMemory' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'VfsFs' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423491 using plugin 'WebCertificate' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'WebPage' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 using plugin 'WindowsEventlog' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.423491 lowering the plugin WindowsPerfInstance capacity to 1 as the configured capacity 100 exceeds limits
                          2022/08/03 13:58:19.423491 using plugin 'WindowsPerfInstance' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.423994 using plugin 'WindowsPerfMon' (built-in) providing following interfaces: exporter, collector, runner
                          2022/08/03 13:58:19.424012 using plugin 'WindowsServices' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.424012 using plugin 'Wmi' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.424012 using plugin 'ZabbixAsync' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.424012 using plugin 'ZabbixStats' (built-in) providing following interfaces: exporter, configurator
                          2022/08/03 13:58:19.424012 lowering the plugin ZabbixSync capacity to 1 as the configured capacity 100 exceeds limits
                          2022/08/03 13:58:19.424012 using plugin 'ZabbixSync' (built-in) providing following interfaces: exporter
                          2022/08/03 13:58:19.424012 [Modbus] Config is valid
                          2022/08/03 13:58:20.117136 Plugin support version 1.0
                          2022/08/03 13:58:20.117136 Zabbix Agent2 hostname: [LT-TP NEW-ERP-Agent2]
                          2022/08/03 13:58:20.117136 starting manager
                          2022/08/03 13:58:20.117669 [0] starting listener for '0.0.0.0:10052'
                          2022/08/03 13:58:20.117669 listening for control connections on \\.\pipe\agent.sock

                          Comment

                          • vladimir_lv
                            Senior Member
                            • May 2022
                            • 240

                            #15
                            1. Set the parameter in your config file:
                              Code:
                               DebugLevel=4
                            2. Restart agent
                            3. Run the command
                              Code:
                               zabbix_agent2 -c "C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf" -t smart.disk.get
                              Make sure that the path for the config file is correct
                            4. Check the log
                            The log should look like:
                            Code:
                            2022/08/03 09:09:30.355310 [1] processing update request (1 requests)
                            2022/08/03 09:09:30.355915 [1] adding new request for key: 'smart.disk.get[/dev/sda,""]'
                            2022/08/03 09:09:30.355915 [1] created direct exporter task for plugin 'Smart' itemid:0 key 'smart.disk.get[/dev/sda,""]'
                            2022/08/03 09:09:30.355915 executing direct exporter task for key 'smart.disk.get[/dev/sda,""]'
                            2022/08/03 09:09:30.478884 executed direct exporter task for key 'smart.disk.get[/dev/sda,""]'

                            Comment

                            Working...