ExportXMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.33rc1, 7.4.17rc1, 8.0.0rc3
    • Component/s: Agent (G)
    • None
    • Environment:

      Steps:
      1. zabbix_agentd.conf: ServerActive=<server>, Hostname=hostA,hostB
      2. Hosts hostA and hostB, each with an active agent.hostname item
      3. zabbix_get -s <agent> -k agent.hostname
      Quicker: zabbix_agentd -c zabbix_agentd.conf -t agent.hostname

      Expected (per the agent.hostname documentation; as in 6.0 and agent 2): hostA's item returns hostA, hostB's item returns hostB; the passive check and -t return hostA.
      Actual: all return hostB. Without ServerActive, the passive check and -t return hostA.

      Cause: add_serveractive_host_agent_cb() (add_serveractive_host_cb() in 7.0) in src/zabbix_agent/zabbix_agentd.c sets the thread-local zbx_config_hostname in the main process for each hostname; forked processes inherit the last value, and the active checks process never sets its own (6.0 set CONFIG_HOSTNAME in the active checks thread). Introduced in 7.0.0alpha3 by DEV-2176 (0fdca1f78f9, b1d78d625ce). On Windows (by code), worker threads start with zbx_config_hostname unset, so all return the first hostname: hostB's active item returns hostA.

            Assignee:
            Zabbix Development Team
            Reporter:
            Andrii Fediuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: