Ad Widget

Collapse

Some time_shift troubles

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eudald Valcarcel
    Junior Member
    • Jul 2011
    • 7

    #1

    Some time_shift troubles

    Hi there,
    I'm trying to make a trigger basically reporting something like this:
    if N > 1000 then check N+1(next N) > N

    I've seen on support webpage that the functionality time_shift was done to compare different time-values, but i'm just collapsed into that sentence:

    {host:mqueue_count[sacarino_br].last(0)}> {host:mqueue_count[sacarino_br].last(300)}/{host:mqueue_count[sacarino_br].last(300)}>1000

    (mqueue_count is an item that works properly and return an integer).
    Just this way, this code is supposed to:
    1.- check the value of the item.
    2.- after 300 seconds, check the 2nd value of the item
    3.- if the first value is higher than 1000, and the second value is higher than frist value, the trigger will prompt on zabbix monitor.

    Can you help me?
    Thanks in advance

    Eudald
  • Eudald Valcarcel
    Junior Member
    • Jul 2011
    • 7

    #2
    Can anyone help me with it? I've noticed that my trigger is not working as it should.

    Thanks in advance,
    Eudald

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Originally posted by Eudald Valcarcel
      Hi there,
      I'm trying to make a trigger basically reporting something like this:
      if N > 1000 then check N+1(next N) > N
      Please could you rephrase it. It is not quite clear what you are trying to achieve.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • Eudald Valcarcel
        Junior Member
        • Jul 2011
        • 7

        #4
        Sure, of course.

        What I mean is:

        I get an integer as a result of a query check (that's the item).
        It's refreshed every 5 minutes.

        I want to make a trigger that can work doing as shown next:

        - Get the integer of the item and compare with a standard value (in this case, 1000, named N).
        - Get the 5 minutes next value and compare with the result of the first step.
        - If the value is higher than this result, then the trigger must prompt

        Hope it's more clear.

        Thanks,
        Eudald

        Comment

        • ghoz
          Senior Member
          • May 2011
          • 204

          #5
          you just have to think of "previous vs actual" value
          rather than actual VS future value

          something like (with 5 minutes interval)
          item.last(0) - item.prev(0) > item.prev(0) AND item.prev(0) >1000 ?

          or item.last(0) - 2 * item.prev(0) > 0 AND item.prev(0) >1000 ?


          if i understand correctly, you want to know if your value more that doubled in the last 5 minutes ? I'm curious, what kind of item are you monitoring ?
          Last edited by ghoz; 09-07-2011, 10:21. Reason: trigger -> item confusion.

          Comment

          • Eudald Valcarcel
            Junior Member
            • Jul 2011
            • 7

            #6
            Hi Ghoz, i don't want to know if the value doubled, just if the value incremented in case the first value was 1000 or higher.

            I'm using it to control a sender, to check if it's sending the mails properly.

            Eudald

            Comment

            • ghoz
              Senior Member
              • May 2011
              • 204

              #7
              Originally posted by Eudald Valcarcel
              Hi Ghoz, i don't want to know if the value doubled, just if the value incremented in case the first value was 1000 or higher.
              that's not what you said :-)

              Originally posted by Eudald Valcarcel
              Sure, of course.
              - Get the integer of the item and compare with a standard value (in this case, 1000, named N).
              - Get the 5 minutes next value and compare with the result of the first step.
              - If the value is higher than this result, then the trigger must prompt
              anyway i think
              item.last(0) - item.prev(0) > 1000 will do the trick... with 5 minutes interval

              if you realy want the trigger to fire if the proev calue is > 1000 AND it increased by more thant 1000,
              then use somthing like
              item.prev(0) > 1000 AND (item.last(0) - item.prev(0) > 1000 )

              if you need to change the 1000 at the host level you can create a macro {$MAX_MAILQ_INCREASE} or something...
              Last edited by ghoz; 09-07-2011, 10:46.

              Comment

              • Eudald Valcarcel
                Junior Member
                • Jul 2011
                • 7

                #8
                I think i'm explaining too bad or my english is worst that what i thought

                i don't want to check if the value was increased by 1000, just if increased from 1000 to 1001.. 2.. 3.. etc

                When you talk about item.prev and item.last, are these the right commands just replacing item by the name i've given to it?

                Thanks a lot!
                Eudald
                Last edited by Eudald Valcarcel; 11-07-2011, 14:20.

                Comment

                • ghoz
                  Senior Member
                  • May 2011
                  • 204

                  #9
                  ok,
                  in thins case
                  item.prev(0) > 1000 AND (item.last(0) > item.prev(0))

                  (and yes you have to replace the 'item' by your definition, and use the right syntax with {} and everything :-)

                  Comment

                  Working...