Ad Widget

Collapse

Zabbix Agent2 active on Windows smart.disk,get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jinu
    Junior Member
    • Apr 2021
    • 7

    #1

    Zabbix Agent2 active on Windows smart.disk,get

    Hi Folks

    I have installed Zabbix agent2 active on a windows 10 system. I also installed smartmon tools on the PC and included that in the PATH so that i can run smartctl from path

    However after starting the agent i see the following errors in the log

    Code:
    2021/04/13 10:54:06.071806 check 'smart.disk.get' is not supported: Failed to execute smartctl: Command execution failed: exit status 1.
    2021/04/13 10:55:06.062569 check 'smart.disk.get' is not supported: Failed to scan for devices: Cannot unmarshal JSON: invalid character '\'' looking for beginning of value..
    2021/04/13 10:56:06.085848 check 'smart.disk.get' is not supported: Failed to scan for devices: Cannot unmarshal JSON: invalid character '\'' looking for beginning of value..
    2021/04/13 10:57:06.096647 check 'smart.disk.get' is not supported: Failed to scan for devices: Cannot unmarshal JSON: invalid character '\'' looking for beginning of value..
    Any ideas how to fix this ?

    EDIT 1: There was one more weird issue after i installed the agent2 version 5.6.3. It refused to start saying cannot find configuration file zabbix_agent2.win.conf. When i checked the folder i did not find the file only the zabbix_agent2.conf file was there so i copied the same file and renamed it as zabbix_agent2.win.conf and it started working. I getting most of the data on the Zabbix server, just the smart.disk is not working

    EDIT 2: I did some more test and figured out what is causing the problem, i cant figure out a solution for the same.

    The issue is that the agent is not able to execute with admin privileges. When i test the agent in a command window using the command

    Code:
    zabbix_agentd -t smart.drive.get
    I get the same error "Failed to execute smartctl: Command execution failed: exit status 1."

    If i run the same command from a Admin command window it works fine.

    To resolve this i tried running the zabbix_agent2 service using a local admin id, but still get the same error. No idea what more i can do to fix this

    Any ideas, troubleshooting steps are welcome

    EDIT 3: Ok some more testing
    - I know zabbix_agent2 is running with admin privileges because the logfile created is done with owner as administrator group and within program files which would require admin privileges
    - smartctl works fine and gets disk data irrespective of whether i run the command in admin command window or regular command window

    Last edited by jinu; 13-04-2021, 11:43.
  • jinu
    Junior Member
    • Apr 2021
    • 7

    #2
    Hi

    Can anybody help on this issue ?

    Comment

    • satanasdiabolo
      Junior Member
      • May 2021
      • 1

      #3
      Hello,

      I have the same error.
      When running
      Code:
      zabbix-agent2 -t smart.disk.get
      in a normal powershell prompt I've got this error.
      When running the same command in an administrative powershell prompt, I've got a JSON output.

      Is there any solution to run zabbix-agent2 as an admin ?

      Comment

      • Dr-primo
        Junior Member
        • Jan 2022
        • 1

        #4

        Any solution to this problem?

        Comment

        • vagner.dias
          Junior Member
          • Mar 2022
          • 1

          #5
          Originally posted by Dr-primo
          Any solution to this problem?
          Hi Dr-Primo. I had this issue and just fixed it.

          check here >>> https://git.zabbix.com/projects/ZBX/..._agent2_active

          The article says that you need to Install the Zabbix agent 2 and >>>> Smartmontools 7.1. <<<<

          Just look for this tool on google and install it. This will create a bunch of links on the start menu. One of those links will install the smartD service on windows and this service will make everything work for you.

          ​​​​​​​Cheers

          Comment

          • JoseAugusto
            Junior Member
            • Jun 2022
            • 1

            #6
            Hi,
            I resolved just paste Plugins.Smart.Path="C:\Program Files\smartmontools\bin\smartctl.exe" in zabbix_agent2.conf.
            Reboot zabbix agent.

            Comment

            • leewp14
              Junior Member
              • May 2023
              • 13

              #7
              Originally posted by JoseAugusto
              Hi,
              I resolved just paste Plugins.Smart.Path="C:\Program Files\smartmontools\bin\smartctl.exe" in zabbix_agent2.conf.
              Reboot zabbix agent.
              Makes no sense (since smartctl is in path and it's the default value), but it works. Thanks a lot. Have a nice day!
              No need to install daemon/service or whatsoever. Just have to add this path in agent config.

              Comment

              • pax0707
                Junior Member
                • Mar 2022
                • 6

                #8
                For me, it added itself to user, not system.
                Manually adding it to system fixed it.

                Comment

                Working...