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

Server tries to find functions in macro context when creating LLD calculated items from prototypes

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.0.5rc1, 3.2.1rc1, 3.4.0alpha1
    • Fix Version/s: None
    • Component/s: Server (S)

      Description

      ZBX-10797 fixed calculated item formula parsing and evaluation, but creation of LLD calculated items from prototypes is still not aware of context macros and tries to find functions (lowercase letters followed by parentheses with some content) inside macro context.

      Look how weird it is:

      Prototype formula Item formula Comments
      {$MACRO:"{#LLD_MACRO}"}
      {$MACRO:"value"}
      That's fine, {#LLD_MACRO} got replaced with value
      {$MACRO:"a({#LLD_MACRO})"}
      {$MACRO:"a({#LLD_MACRO})"}
      Zabbix thinks a(...) is a function and expects host:key reference in the first parameter, where LLD macros are not substituted
      {$MACRO:"a(,{#LLD_MACRO})"}
      {$MACRO:"a(,value)"}
      Still, Zabbix thinks a(...) is a function but now resolves LLD macro in its second parameter
      {$MACRO:"a(,{#LLD_MACRO})"}
      {$MACRO:"a(,"   <-leading and trailing whitespace->   ")"}
      Here Zabbix even put double quotes around fake function parameter

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              glebs.ivanovskis Glebs Ivanovskis (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: