Ad Widget

Collapse

How to have trigger relate to multiple values?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • high-t
    Member
    • Dec 2014
    • 68

    #1

    How to have trigger relate to multiple values?

    Hi.
    I need to report the current and previous values of my host's cpu utilization value when it changes.
    Here are my settings:

    Zabbix Version (Servers, Proxies, Agents): latest 4.4
    Host is reporting to Active proxy.
    Active agent.
    Trigger name: Value Changed
    Operational data: Value Changed from {ITEM.VALUE1} to {ITEM.VALUE2}
    Expression: {server.name:system.cpu.util.diff()}=1 [where server.name is my host name]

    Last data shows change on the reading of cpu.util , and the trigger fires. So far so good.
    But the values for both {ITEM.VALUE1} and {ITEM.VALUE2} macros are the same: the last value of cpu.util .

    How do I get this to work?

    Thank you in advance!
    Amit.
    Last edited by high-t; 16-01-2020, 00:06.
  • high-t
    Member
    • Dec 2014
    • 68

    #2
    Originally posted by splitek
    To use indexed macros such as {ITEM.VALUE1} and {ITEM.VALUE2}, you must use two item keys in the expression. Example of the expression:
    {server.name:system.cpu.util.last(#1)} <> {server.name:system.cpu.util.last(#2)}
    Left part is {ITEM.VALUE1}, right {ITEM.VALUE2}


    Or you can try to use {{HOST.HOST}:{ITEM.KEY}.last(#1)} {{HOST.HOST}:{ITEM.KEY}.last(#2)} in notification, ie.
    change was from {server.name:system.cpu.util.last(#1)} to {server.name:system.cpu.util.last(#2)}
    Thank you, splitek . Used your expression, but still yet: I'm getting the same value (which is the latest value) in both macros.
    Example:
    Operational data Value Changed from 3.184 % to 3.184 %

    Can you try this in your environment?
    I fail to understand what am I doing wrong..

    Thank you.
    Amit.

    Comment

    • high-t
      Member
      • Dec 2014
      • 68

      #3
      Thank you splitek . I was able to resolve this. As it turn out, the {ITEM.VALUE1-9} is useless, as it always return last value (I don't understand if this is a bug or a feature, but it's useless anyhow).
      However, {{HOST.HOST}:{ITEM.KEY}.last(#1)} , {{HOST.HOST}:{ITEM.KEY}.last(#2)} etc are usable and react as expected, delivering historical data. See screenshot here below:

      Click image for larger version

Name:	slack-screenshot.png
Views:	2969
Size:	27.2 KB
ID:	393803

      Comment

      Working...