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

User macro not expanded in calculated items prototypes

    Details

      Description

      Hello,

      I have an LLD rule that discovers Oracle tablespaces and sets up two items prototypes (tablespace size and tablespace usage). This is working OK.
      I need to compute the usage percentage, so I created a new item prototype with type "computed".
      This is the formula I'm using:

      100*last("oracle.tbs_free[\"{$MONUSER}\",\"{$MONPASS}\",\"{#ORASID}\",\"{#TBS}\"]",0)/last("oracle.tbs_size[\"{$MONUSER}\",\"{$MONPASS}\",\"{$ORASID}\",\"{#TBS}\"]",0)
      

      I see that {#ORASID} and {#TBS} correctly get replaced with their values but {$MONUSER} and {$MONPASS} don't, so the item doesn't get populated (generates "cannot evaluate function last error.

      According to the documentation they should be replaced:
      https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/calculated
      "User macros in the formula will be expanded if used to reference a parameter or a constant.
      User macros will NOT be expanded if used to reference a function, host name, item key or operator."

      I'm not sure if this is a duplicate of this other, now closed, issue: ZBX-5540.

      Thanks!

      Gabriele Paggi

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gpaggi Gabriele Paggi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: