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

User macro not expanded as parameter for calculated item

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.4
    • Fix Version/s: None
    • Component/s: Documentation (D)
    • Labels:
      None

      Description

      I was initially searching for some way to aggregate/calculate the total bandwidth of a zabbix-agent, but there is no way to do that through LLD.
      So, I wanted to use an intermediate calculated item at the host level (through template) but there is no wildcard support for there (so can't use {#IFNAME*} as a simple example

      I tried to then define a user macro {$ETH_PUB_INT} and use that in the calculated item :

      Type: Calculated
      Item name : net.bw.out
      Formula : last("net.if.out[{$ETH_PUB_INT}]")

      But then at the zabbix server log, it says :

      error reason for "host.domain.com:net.bw.out" changed: Cannot evaluate function "last()": item "host.domain.com:net.if.out[{$ETH_PUB_INT}]" does not exist.

      So it seems that it's not expanding user macro to eth0 (as defined at the host level) and from doc (https://www.zabbix.com/documentation/3.0/manual/config/items/itemtypes/calculated) it seem that "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."

      In my case, it's not an item key, but a paramater for an item key, so shouldn't it be expanded ??

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arrfab Fabian Arrotin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: