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

Allow macros to be escaped within item key parameters

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: Server (S)
    • Environment:
      Linux, CentOS-6, PostgreSQL 9.1.4, Apache HTTPD-2.2.15, PHP-5.3.3

      Description

      Please provide a way to avoid the substitution of macros within an item key definition.

      For example:
      Macro: {$USER_MACRO}=>bar
      Item key: foo["{$USER_MACRO}"]

      can not be referenced correctly in items of type "Zabbix aggregate".
      I tried it in several ways without success:
      grpsum["Example Group","foo[\"{$USER_MACRO}\"]",last,0] --> foo["bar"]
      grpsum["Example Group","foo[\"{\$USER_MACRO}\"]",last,0] --> foo["{\$USER_MACRO}"]
      grpsum["Example Group","foo[\"{$$USER_MACRO}\"]",last,0] --> foo["{$$USER_MACRO}"]
      grpsum["Example Group","foo[\"\{$USER_MACRO\}\"]",last,0] --> foo["\{$USER_MACRO\}"]

      And if I haven't overlooked something in the source code such a behavior is actually not implemented.

      The only way to work-around this issue was adding another user macro which is set to the origin user macro definition and use this instead:
      Macro: {$USER_MACRO}=>bar
      Macro: {$USER_MACRO_BAR}=>{$USER_MACRO}
      Item (Zabbix aggregate): grpsum["Example Group","foo[\"{$USER_MACRO_BAR}\"]",last,0] => foo["bar"]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                okkuv9xh Marc
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: