Ad Widget

Collapse

Formula on Item drives me nuts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bernd Hohmann
    Member
    • Mar 2013
    • 46

    #1

    Formula on Item drives me nuts

    After trying this in all variants for the last 2 days, I give up...

    I created an item "Inbound" in a host..

    Code:
    Host: donald
    Name: Inbound
    Type: Zabbix agent
    Key: net.if.in[{$IF.NAME}]  (user macro defined as "eth0")
    Host interface: the agent
    Type of information: Numeric (unsigned)
    Data type: Decimal
    Units: bps
    Multiplier: 8
    Works fine. Displays graph and so on.

    Then I like to calculate an average over "Inbound" for 600 seconds so I created another Item named "AverageInbound":

    Code:
    Host: donald
    Name: AverageInbound
    Type: Calculated
    Key: AvgIn
    Formula: avg("donald:inbound",600)
    Result:
    "Cannot evaluate function [avg(60)]: item [donald.:Inbound] not found"

    I tried it in different flavours. With " and without.

    It works when I move "net.if.in[{$IF.NAME}]" into the formula, but this is not welcome.

    Is there any chance to use an item in a calculated item?

    Bernd
  • heaje
    Senior Member
    Zabbix Certified Specialist
    • Sep 2009
    • 325

    #2
    Use the item key in the calculated item as shown on the zabbix documentation page about calculated items. do not use the host:name syntax.

    Comment

    • Bernd Hohmann
      Member
      • Mar 2013
      • 46

      #3
      Originally posted by heaje
      Use the item key in the calculated item as shown on the zabbix documentation page about calculated items. do not use the host:name syntax.
      Ok. When I use a key like "net.if.in[eth0]" in the formula, which value does the formula use? The direct values from "net.if.in" or the calculated values from "Inbound" (where the key was defined)?

      Thats important for me because the item "Inbound" works with the difference between two values.

      Bernd

      Comment

      • heaje
        Senior Member
        Zabbix Certified Specialist
        • Sep 2009
        • 325

        #4
        It uses the already collected values from the item key you specify.

        Comment

        • Bernd Hohmann
          Member
          • Mar 2013
          • 46

          #5
          Thanks a lot for your answer!

          Bernd

          Comment

          Working...