Ad Widget

Collapse

macros stopped to substitute in the agent (7)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wojkuk
    Junior Member
    • Sep 2024
    • 3

    #1

    macros stopped to substitute in the agent (7)

    Hello,

    Some of the items on my hosts stopped working - the error "special characters .... are not allowed in the parameters" started appearing i zabbix_agent logs.
    it's strange because it worked before and looking in the GUI I see that the macros still exist (or are inhrerited from the template).

    Now I see errors in zabbix_agent.log looking like this:
    Code:
    active check "file.stat[{$SYSLOG_FILE},14]" is not supported: Special characters "\, ', ", `, *, ?, [, ], {, }, ~, $, !, &, ;, (, ), <, >, |, #, @, 0x0a" are not allowed in the parameters.
    It looks like zabbix_agent is getting "raw" configuration without any macros substituted.

    A week earlier we migrated the entire infrastructure to zabbix7 and proxygroups.
    The problem appeared after several days - as if only after some discovery, or previous items expired, or some failover on proxygroups.
  • wojkuk
    Junior Member
    • Sep 2024
    • 3

    #2
    Additional findings:
    After changing the proxy to generic, the macros are translated to strings like /var/log/syslog in the item parameters and everything goes back to normal.
    But after returning to the proxygroup, the agent starts executing items with unresolved macros like {$SYSLOG_FILE} again.

    I checked mysql databases of both proxies, and all entries (items, hosts, hostmacro, host_template) are identical.
    It looks like "generic" zabbix_proxy resolves macros when sending config to agent, and proxygroup sends raw config, without lookup to hostmacros.

    Both proxies are 7.0.3 Revision d93ce022627
    Last edited by wojkuk; 20-09-2024, 12:56.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 5007

      #3
      You can submit a bug report at https://support.zabbix.com/projects/ZBX/issues/ to get it confirmed and fixed.

      Comment

      • wojkuk
        Junior Member
        • Sep 2024
        • 3

        #4

        Comment

        • Guigz33
          Junior Member
          • Nov 2024
          • 8

          #5
          Same issue here, still present in 7.0.32 - detailed timeline

          We hit exactly this behaviour three times this month (7.0.29, then 7.0.32), with proxy groups of 2 active proxies.

          Symptom: items inherit user macros from templates, but the affected proxy starts sending raw keys/parameters (e.g. system.run[{$MACRO}], web.certificate.get[{$FQDN},{$PORT}], HTTP agent URLs containing {$...}). Items go unsupported, while "Test" from the frontend works (macros are resolved server-side). The proxy stays online and logs no error. The proxy's local database is correct (host-template links and template macros present).

          What fixes it: only a restart of zabbix-proxy. "zabbix_proxy -R config_cache_reload" and editing the macros do not help. Moving the host to a standalone proxy also fixes it, as described above.

          Timeline from today (server log):
          - 10:28:25 Proxy A goes offline (~1 min)
          - 10:28:37 Proxy B receives a full-size config (~3.1 MB): hosts reassigned to B
          - 10:40:17 Proxy A receives a full-size config: hosts moved back to A -> macros OK
          - 11:08:30 Proxy A goes offline again (~1m40)
          - 11:08:52 Hosts reassigned to proxy B
          - 11:20:35 Proxy A receives a full-size config: hosts moved back to A
          - 11:21:09 First item with an unresolved template macro on proxy A, then all affected hosts within one 5 min cycle
          - 11:47 zabbix-proxy restarted on A -> everything recovers within minutes

          So the trigger seems to be the host reassignment back to the proxy after a failover, and it is not deterministic: the same move-back worked at 10:40 and failed at 11:20. Only hosts assigned to proxy A were affected; the twin proxy B was fine.

          Settings: failover delay 1m, min online 1, active proxies, agent 2 active checks plus proxy-side checks (HTTP agent, simple checks) both affected.

          This looks like ZBX-25413 (the duplicate of ZBX-25283 linked above), which is marked as fixed in 7.0.17. We are well above that (7.0.29 and 7.0.32) and still hit it, but only after a failover and the host being reassigned back to the proxy, and not every time (10:40 OK, 11:20 broken). So either the fix is incomplete or the reassignment path regressed. We are opening a new ZBX issue referencing ZBX-25413 with these details.

          Comment

          Working...