Ad Widget

Collapse

Problem with "item.value" / "item.lastvalue" in actions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frankp
    Junior Member
    • Jun 2010
    • 20

    #1

    Problem with "item.value" / "item.lastvalue" in actions

    Morning guys,
    found some information regarding "item.value" and "item.lastvalue" like starting with variable at col 1 in a new line, ...
    But I never got anything else than the values of "item.(last)value" and "item.(last)value1" which contain the same data. Wasn't able to get values for anyone of the other (item-lastvalue2...9) variables.

    My environment:

    Operating system:
    -CentOS release 5.4 (Final)
    -Linux HOST.DOMAIN 2.6.18-164.11.1.el5PAE #1 SMP Wed Jan 20 08:16:13 EST 2010 i686 i686 i386 GNU/Linux

    Zabbix-Server:
    30650:20100619:074601.186 Starting Zabbix Server. Zabbix 1.8.2 (revision 11211).
    30650:20100619:074601.186 **** Enabled features ****
    30650:20100619:074601.186 SNMP monitoring: YES
    30650:20100619:074601.186 IPMI monitoring: YES
    30650:20100619:074601.187 WEB monitoring: YES
    30650:20100619:074601.187 Jabber notifications: NO
    30650:20100619:074601.187 ODBC: NO
    30650:20100619:074601.187 SSH2 support: YES
    30650:20100619:074601.187 IPv6 support: YES
    30650:20100619:074601.187 **************************
    My trigger:
    (see trigger.PNG)
    My action:
    (see action.PNG)
    Details of the "default message" field:
    EventSystem: {HOSTNAME}
    EventStatus: {STATUS}
    DateTimeNOW: {DATE} {TIME}
    EventDateTIME: {EVENT.DATE} {EVENT.TIME}
    EventAge: {EVENT.AGE}
    ItemName: {ITEM.NAME}
    ItemLastValue: {ITEM.LASTVALUE}
    Comment: {TRIGGER.COMMENT}
    EventTrigger: {TRIGGER.NAME}

    Current ITEM-LASTvalue:
    {ITEM.LASTVALUE1} = ItemLastValue1

    Previous ITEM-LASTvalues:
    {ITEM.LASTVALUE2} = ItemLastValue2
    {ITEM.LASTVALUE3} = ItemLastValue3
    {ITEM.LASTVALUE4} = ItemLastValue4

    Current ITEM-Value:
    {ITEM.VALUE1} = ItemValue1

    Previouse ITEM-Values:
    {ITEM.VALUE2} = ItemValue2
    {ITEM.VALUE3} = ItemValue3
    {ITEM.VALUE4} = ItemValue4
    {ITEM.VALUE5} = ItemValue5

    Escalation history:
    {ESC.HISTORY}
    The resulting mail:
    Subject: CPU User load is too high on SYSTEM-A: PROBLEM

    EventSystem: SYSTEM-A
    EventStatus: PROBLEM
    DateTimeNOW: 2010.06.29 14:24:49
    EventDateTIME: 2010.06.29 14:24:44
    EventAge: 0m
    ItemName: CPU user time (avg1)
    ItemLastValue: 99.040918
    Comment: CPU User load is to low on SYSTEM-A .
    The treshold is 98%, it seams that there are user processes
    consuming to much CPU. Connect to the system and check the
    processes with top or nmon.
    EventTrigger: CPU User load is too high on SYSTEM-A

    Current ITEM-LASTvalue:
    99.040918 = ItemLastValue1

    Previous ITEM-LASTvalues:
    *UNKNOWN* = ItemLastValue2
    *UNKNOWN* = ItemLastValue3
    *UNKNOWN* = ItemLastValue4

    Current ITEM-Value:
    99.0409 = ItemValue1

    Previouse ITEM-Values:
    *UNKNOWN* = ItemValue2
    *UNKNOWN* = ItemValue3
    *UNKNOWN* = ItemValue4
    *UNKNOWN* = ItemValue5

    Escalation history:
    Problem started: 2010.06.29 14:24:44 Age: 0m
    Attached Files
  • Wonderer
    Member
    Zabbix Certified Specialist
    • May 2010
    • 53

    #2
    According to the manual {ITEM.LASTVALUE<1-9>} is "The latest value of the Nth item of the trigger expression which caused a notification". And if I understand it in the correct way it means that if your trigger expression is using several items for trigger expression calculation you can use above to get the last values for each of them. For example in the using following trigger expression
    Code:
    {T_Template_Linux_Base:system.cpu.util[,user,avg1].last(0)}>98 & {T_Template_Linux_Base:system.cpu.util[,user,avg5].last(0)}>75
    {ITEM.LASTVALUE1} will show the last value for the item util[,user,avg1] and the {ITEM.LASTVALUE2} will show the last value for the item util[,user,avg5].

    Probably what you are looking for is {{HOSTNAME}:{TRIGGER.KEY}.last(#2)} (the second most recent value), {{HOSTNAME}:{TRIGGER.KEY}.last(#3)} (the third most recent value), etc.

    Can you try with this Macros in the action and report the results?

    Comment

    • frankp
      Junior Member
      • Jun 2010
      • 20

      #3
      Morning Wonderer,

      thanks for your tip. The macros you posted are working.

      Do you have any idea why the documented macros don't work as described?
      I do not use several items within the mentioned trigger.

      Wish you a nice day
      Regards
      Frank

      Comment

      • Wonderer
        Member
        Zabbix Certified Specialist
        • May 2010
        • 53

        #4
        Actually they work as described.
        May be you understand it in the wrong way.
        Again. In documentation it is clearly said that "The latest value of the Nth item of the trigger expression which caused a notification", and NOT "The Nth latest value of the item of the trigger expression which caused a notification". Feel the difference

        If you are not using several items with you triggers, it means that only {ITEM.LASTVALUE1} is valid, as you have only ONE item.
        If you use TWO items in the trigger expression also {ITEM.LASTVALUE2} will be valid, but not the others (3,4,5,etc).

        Comment

        • MrKen
          Senior Member
          • Oct 2008
          • 652

          #5
          frankp,

          See the first discussion note by richlv, on this page
          http://www.zabbix.com/documentation/1.8/manual/config/macros

          MrKen
          Disclaimer: All of the above is pure speculation.

          Comment

          • subba5678
            Senior Member
            • May 2010
            • 132

            #6
            Hi,
            I configured the Triggers in a way that it needs to trigger the alert based on severity i.e "High" Severity .But it is triggering the alerts even if the severity is in "Warning" . Please help me out so that it needs to trigger only with the "High" Severity alerts. Please find the attachment of my trigger Configuration. Please help me out

            Thanks,
            Subbu
            Attached Files

            Comment

            Working...