Ad Widget

Collapse

Remote command upon host discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cerasus
    Junior Member
    • Mar 2020
    • 24

    #1

    Remote command upon host discovery

    I've configured a network discovery rule for a subnet. One of the actions upon discovery is to execute a remote command on the proxy that discovered the host. What I'm seeing is that the remote command is not executed upon the discovery. The command has a macro in it: {DISCOVERY.DEVICE.IPADDRESS}. When I go to the action log, I see that the command fails and when I hover over the exclamation point, I see "Unknown host".

    Attaching a screenshot of that.

    Any idea why? The command is listed with the correct arguments.
    Attached Files
    Last edited by cerasus; 27-03-2020, 18:59.
  • cerasus
    Junior Member
    • Mar 2020
    • 24

    #2
    That error seems to come from src/zabbix_proxy/taskmanager/taskmanager.c

    Code:
    if (FAIL == DCget_host_by_hostid(&host, hostid))
        {
          task->data = zbx_tm_remote_command_result_create(parent_taskid, FAIL, "Unknown host.");
          goto finish;
        }
    But I still don't quite understand what that means exactly. The command is supposed to be executed on the proxy and so the discovered host shouldn't matter -- even if it was "unknown" for some reason?

    Comment

    • cerasus
      Junior Member
      • Mar 2020
      • 24

      #3
      The command is executed successfully the second time the host is processed. This must be some sort of a race condition where the host doesn't yet exist in the database and so the command fails.

      Comment

      Working...