Ad Widget

Collapse

create trigger for a constantly increasing value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oebele
    Junior Member
    • Jun 2010
    • 13

    #1

    create trigger for a constantly increasing value

    As the title says, I've been trying to create a trigger that should fire when the value of an item is increasing and not decreasing during a certain period of time.

    How would I do that? None of the predefined expressions seem to do what I want.
    Last edited by oebele; 29-12-2010, 16:49.
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    Originally posted by oebele
    As the title says, I've been trying to create a trigger that should fire when the value of an item is increasing and not decreasing during a certain period of time.

    How would I do that? None of the predefined expressions seem to do what I want.
    You could store item variation instead of raw value by selecting "Delta" instead of "As is" as "Store value" option.
    You can then define a trigger as:
    {host:item.min(period)}>0

    Hope this helps
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • oebele
      Junior Member
      • Jun 2010
      • 13

      #3
      Thanks! That was exactly what I was looking for!

      Comment

      • oebele
        Junior Member
        • Jun 2010
        • 13

        #4
        I have a new question related to the previous one:

        I have an item that has a value of 0 most of the time, but sometimes starts growing and returns to 0 after a while. It's actually a queue of messages that's being filled on one end and tries to deliver them at the other. I need a trigger that fires when the delivery is failing, so when the value of the item stays the same for a certain period and is not 0.

        How would I do that? If I store the item as a delta and configure the trigger like this,

        {host:item.min(period)}=0

        it will fire when the queuesize is 0 and stays that way. If I store it as-is, there's no trigger that will fire correctly, unless I'm missing something?

        Anyone have an idea?

        Comment

        • oebele
          Junior Member
          • Jun 2010
          • 13

          #5
          trigger for constant value, not zero

          I have a new question related to the previous one:

          I have an item that has a value of 0 most of the time, but sometimes starts growing and returns to 0 after a while. It's actually a queue of messages that's being filled on one end and tries to deliver them at the other. I need a trigger that fires when the delivery is failing, so when the value of the item stays the same for a certain period and is not 0.

          How would I do that? If I store the item as a delta and configure the trigger like this,

          {host:item.min(period)}=0

          it will fire when the queuesize is 0 and stays that way. If I store it as-is, there's no trigger that will fire correctly, unless I'm missing something?

          Anyone have an idea?

          Comment

          • alixen
            Senior Member
            • Apr 2006
            • 474

            #6
            Hi,

            Originally posted by oebele
            I have a new question related to the previous one:

            I have an item that has a value of 0 most of the time, but sometimes starts growing and returns to 0 after a while. It's actually a queue of messages that's being filled on one end and tries to deliver them at the other. I need a trigger that fires when the delivery is failing, so when the value of the item stays the same for a certain period and is not 0.

            How would I do that? If I store the item as a delta and configure the trigger like this,

            {host:item.min(period)}=0

            it will fire when the queuesize is 0 and stays that way. If I store it as-is, there's no trigger that will fire correctly, unless I'm missing something?

            Anyone have an idea?
            Store it "As is" and set a trigger like {host:item.min(period)}#0

            We use this kind of trigger to monitor Postfix messages queues.
            In fact we use {host:item.min(period)}>{$LEVEL}.

            Regards,
            Alixen
            http://www.alixen.fr/zabbix.html

            Comment

            • oebele
              Junior Member
              • Jun 2010
              • 13

              #7
              thanks for the response Alixen, I was on holiday, hence the long delay.

              Actually the situation is a bit more complicated: I'm not dealing with a Postfix queue that's constantly being filled up, but a queue of sms-messages that gets filled up only at more or less regular intervals, ranging from weekly to daily. The number of messages sent in each run varies wildly, from a few dozen to 20000+.

              The difference with an MTA-queue is that the queue may stay at a high level for a few hours, but that doesn't necessarily mean there's a problem.

              When delivery is failing, the queue will not decrease anymore and regardless of its actual level (though not 0) a trigger should fire. Is there a way to do that in Zabbix?
              Last edited by oebele; 13-01-2011, 14:51.

              Comment

              • JBo
                Senior Member
                • Jan 2011
                • 310

                #8
                Hi,

                This is indeed more complicated.

                Here is a way to do that:
                Create a calculated item that stores variations of SMS queue length:
                • Item key : variation
                • Item type : Float
                • Item formula : last(item) - prev(item)
                • Store value : As is


                Define a trigger as:
                • {host:variation.count(period,0,"gt")} > 0 & {host:variation.count(period,0,"lt")}=0


                This trigger will fire up if queue length has increased during period seconds but never decreased.

                Hope this helps,
                JBo

                Comment

                • oebele
                  Junior Member
                  • Jun 2010
                  • 13

                  #9
                  Thanks, that's very helpful! I will be testing this in the coming week and I'll post here if it's working.

                  --edit: test report

                  So, I've been testing this yesterday and today and I had to make a few modifications to get it to fire when the queue has stalled and is stuck at a certain level, too.

                  The final trigger now has the following form:

                  Item key : variation <- can be any random string
                  Item type : Float
                  Item formula : last(item) - prev(item)
                  Store value : As is

                  Define a trigger as:
                  {host:variation.count(period,0,"ge")} > 0 & {host:variation.count(period,0,"lt")}=0 & host.item.count(period,0,"eq")=0

                  Also, this took me some time to realise, as I hadn't worked with calculated items before: you need an item to base the calculation on. So you'll end up with two items per queue. Trivial in retrospect, but confusing for me nonetheless.
                  Last edited by oebele; 18-01-2011, 15:18.

                  Comment

                  • rodeur2080
                    Junior Member
                    • Nov 2019
                    • 9

                    #10
                    Hello,

                    Originally posted by oebele
                    As the title says, I've been trying to create a trigger that should fire when the value of an item is increasing and not decreasing during a certain period of time.

                    How would I do that? None of the predefined expressions seem to do what I want.
                    I am trying to do the same thing but I am in version 4.0 LTS. The storage of the delta no longer exists.
                    Do you have an idea ?

                    I am looking for a trigger for a constant increase on the last 6 values.

                    Regards,

                    Comment

                    • rodeur2080
                      Junior Member
                      • Nov 2019
                      • 9

                      #11
                      I create the trigger by performing a comparison of the last 6 values with function last (# 1> # 2 and # 2> # 3 ...) but it's a bit heavy.
                      Do you know a simpler solution?

                      Comment

                      Working...