Ad Widget

Collapse

How to obtain the latest two values of the same monitoring item in a custom message?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wangwang
    Junior Member
    • Oct 2023
    • 2

    #1

    How to obtain the latest two values of the same monitoring item in a custom message?

    0

    I want to monitor changes in IP, and this is my trigger expression:

    last(/Zabbix server/check.ip[www.a.com])<>last(/Zabbix server/check.ip[www.a.com],#2)


    I want to reflect the changes in new and old IPs,and I knew you can use {ITEM.VALUE<1-9>} to get multi values when there are multi items in one trigger, so I didn't use the change() method, and my custom alert message is like this:
    TITLE:{EVENT.NAME}
    IP CHANGE:{ITEM.VALUE2} ==> {ITEM.VALUE1}
    EVENT TIME:{EVENT.DATE} {EVENT.TIME}
    EVENT ID:{EVENT.ID}


    But I found that {ITEM. VALUE1} and {ITEM. VALUE2} always get the same value, which is the latest value of the monitored item。 Does {ITEM.VALUE<1-9>} always get the same last value when using the same items in the trigger expression?
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    The macro references not the function in trigger expression but the item itself, that is used in expression. As both functions in your trigger use same items -> the macro will resolve to the same value.

    You can try use expression macro instead. I've not used them before in real life scenarios but they seems like exactly the tool you are looking for to get your idea working.

    Comment

    Working...