Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22777

Undefined user macro is resolved to user macro name

XMLWordPrintable

    • Sprint 100 (May 2023), Sprint 101 (Jun 2023), Sprint 102 (Jul 2023)
    • 0.25

      Steps to reproduce:

      • Create a new Host
      • Add a SNMP Interface
      • Create a template where you define the Macros needed for the interface configuration but forget to create the “{$SNMP_CONTEXT} macro
      • Add some SNMP Agent Item to the Host

        Result:
      • The SNMP Interface will become “Not available” with a timeout error: “Timeout while connecting...".
      • If you click on the SNMP Item on the host and click “Test” the item works and you get a value back, since device is configured without context name.

      This is caused by the fact that in the SNMP Interface configuration in the “Context name” field the macro “{$SNMP_CONTEXT}” is set, but this macro has not been defined on the Template or Host
      What seems to be happening is that for “normal” SNMP Items checks Zabbix is sending the Value {$SNMP_CONTEXT} as context name since the macro has not been defined, but when manually testing the Item Zabbix seems to not send this context name → this is inconsitent und leads to confusion while troubleshooting because the interface gives a timeout error while a manual test works just fine.

      Documentation:
      https://www.zabbix.com/documentation/current/en/manual/config/macros/user_macros

      If Zabbix is unable to find a macro, the macro will not be resolved.

      Expected:
      Consistent behaviour of the undefined macro - no value or macro name returned and also described behaviour in the documentation.

            iivs Ivo Kurzemnieks
            edgar.akhmetshin Edgar Akhmetshin
            Team B
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: