Ad Widget

Collapse

Zabbix Agent 5.4 Windows - Setting up a custom active agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carlsteffen
    Junior Member
    • Nov 2021
    • 4

    #1

    Zabbix Agent 5.4 Windows - Setting up a custom active agent

    I have an environment in which a handful of windows 10 PCs have direct connectivity via an MPLS tunnel to a couple remote resources. My Zabbix Server is firewalled off in a way that it cannot (and should not) be able to see these resources, but it CAN communicate with the windows 10 clients.

    I need to track uptime (and sound alarms when it's down) through the MPLS tunnel and I'm trying to use active agents on the windows 10 PCs. I've found various articles on how to do this, but I'm struggling to figure out what I'm doing wrong - so I'm breaking this down to the simplest of test cases without even involving the server yet (NOTE the agent does have a server specified)

    I've found various articles that describe setting up dynamic user parameters etc on the agent, but after following them I was getting a generic error on the Zabbix server "Unsupported item key."

    I wanted to boil this down to the simplest test case possible thinking my error would show itself, but so far I've failed to find it. At this point I have a windows 10 PC with Zabbix Agent 5.4 installed. I've opened a command prompt and navigated to c:\Program Files\Zabbix Agent\ and ran this command to verify functionality before any changes:
    Code:
    C:\Program Files\Zabbix Agent>zabbix_agentd.exe -t agent.version
    agent.version [s|5.4.7]
    C:\Program Files\Zabbix Agent>
    Below are the only lines not commented out in zabbix_agentd.conf - NOTE that I've added the comments in this post and that they do not actually exist in my conf file currently:
    Code:
    LogFile=C:\Program Files\Zabbix Agent\zabbix_agentd.log ##### default from installation
    AllowKey=system.run[*] ##### have tried with/without this line- no effect
    UserParameter=ping.test1,echo 1 ##### my test key/shell command - just going to return "1"
    Server=10.x.x.x ##### default from installation
    ServerActive=10.x.x.x ##### default from installation
    Hostname=YYYYYYY ##### default from installation
    Include=C:\Program Files\Zabbix Agent\zabbix_agentd.d\ ##### default from installation
    When I run the following command, I get the "Unsupported item key." error:
    Code:
    C:\Program Files\Zabbix Agent>zabbix_agentd.exe -t ping.test1
    ping.test1 [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
    C:\Program Files\Zabbix Agent>
    My understanding is that adding a custom active check should be as simple as adding the one line on the agent conf file - is there anyone out ther that can tell me what I'm missing?

    Thanks in advance.
    Last edited by carlsteffen; 12-11-2021, 23:58.
  • carlsteffen
    Junior Member
    • Nov 2021
    • 4

    #2
    Slight update - I simply did a
    zabbix_agentd.exe -? to see what command line switches are available - and found that I could (and should) pass in the config file name.

    Code:
    C:\Program Files\Zabbix Agent>zabbix_agentd.exe -c zabbix_agentd.conf -t ping.test1
    ping.test1 [t|1]
    C:\Program Files\Zabbix Agent>
    So locally I have it working on the PC. Now I'm trying to test it from the Zabbix server (it is running 5.2 on Ubuntu).

    I restarted the local agent on the PC to ensure that it's using the current config. I also double checked the parameters of the service to ensure it was passing in the same config file as I was editing, then from a terminal window on the Zabbix server ran the following:

    Code:
    /# zabbix_get -s 10.x.x.x -p 10050 -k ping.test1
    ZBX_NOTSUPPORTED: Unsupported item key.
    I'm not sure what to try next on this - open to any suggestions.

    Thanks again.



    Comment

    • Daniel4711
      Senior Member
      • Jul 2014
      • 126

      #3
      Does the following command work from the Zabbix Server?

      Code:
      zabbix_get -s 10.x.x.x -p 10050 -k agent.version

      Comment

      • carlsteffen
        Junior Member
        • Nov 2021
        • 4

        #4
        Yes. It returns "5.4.7"
        Last edited by carlsteffen; 13-11-2021, 00:00.

        Comment

        • carlsteffen
          Junior Member
          • Nov 2021
          • 4

          #5
          Ok, it's working now - but this has proven very strange. Here's what I noticed. As mentioned above "zabbix_get -s 10.x.x.x -p 10050 -k agent.version" returned a version successfully. For reasons I that don't make any sense, I tried running that same command (from the server) while the windows "Services" console showed the service as stop, but it still returned a result successfully (It should not have worked)

          I then went to the "Details" tab of Windows Task Manager - and found that there was a "zabbix_agentd.exe" process running despite the services saying that it was stopped. So from there I went to the "Services" tab of windows task manager and found that in that UI the "Zabbix Agent" service was still running.

          I stopped the Zabbix Agent service using the task manager, and then proceeded to "start" the service using the standard "Services" console - despite the service showing as "Running" there, the Task Manager showed no process running nor the service running.

          I simply restarted the service from the Windows Task Manager and everything worked as expected. It would seem that something is wrong with the installer such that the registration with windows as a service isn't quite right.

          Hope this helps someone else get over this issue and maybe leads to a bugfix with the agent installation.

          Comment

          • mehravishra
            Junior Member
            • Nov 2021
            • 1

            #6
            Does the following command work from the Zabbix Server?

            Comment

            Working...