Ad Widget

Collapse

avg() trigger issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TonyW
    Junior Member
    • Jul 2010
    • 3

    #1

    avg() trigger issue

    Hi,

    I have the following trigger:
    {Template_WES:service_state[STEMDASH].avg(300)}#0

    When the service stops this triggers straight away in the the Dashboard rather than taking the average over 300 seconds. What am I doing wrong?

    Zabbix version 1.8.2

    Update:
    If I do
    {Template_WES:service_state[STEMDASH].avg(300)}=6
    the trigger behaves as expected.

    Best Regards,

    Tony.
    Last edited by TonyW; 29-07-2010, 13:42. Reason: Update on issue
  • QwErTy_LoGiC
    Member
    • Feb 2010
    • 66

    #2
    Expression is evaluated each time the item is updated

    Hello,

    The expression is evaluated each time the item is updated. So, if you poll an item every minute, it is evaluated every minute. The time period covers how many samples will be included in the evaluation.

    So if you have an Avg(300) and poll every minute, the expression is going to evaluate and average the last five samples every time the item is updated.

    Cheers!

    Comment

    • TonyW
      Junior Member
      • Jul 2010
      • 3

      #3
      avg() trigger issue NOT value

      Hi,

      Thanks, it poles fine when equaling a value but not when not the value.

      I have set two triggers to test and stopped the service:

      1. {Template_WES:service_state[STEMDASH].avg(300)}#0
      Triggers as soon as the agent polls.

      2. {Template_WES:service_state[STEMDASH].avg(300)}=6
      Triggers as expected after 5 minutes.

      I would like to use the first trigger, NOT 0, as there are several other states not covered in the second trigger example, I could create multiple OR expressions to check the other states but would look a little untidy.

      Best Regards,

      Tony.

      Comment

      • alixen
        Senior Member
        • Apr 2006
        • 474

        #4
        Originally posted by TonyW
        Hi,

        Thanks, it poles fine when equaling a value but not when not the value.

        I have set two triggers to test and stopped the service:

        1. {Template_WES:service_state[STEMDASH].avg(300)}#0
        Triggers as soon as the agent polls.

        2. {Template_WES:service_state[STEMDASH].avg(300)}=6
        Triggers as expected after 5 minutes.

        I would like to use the first trigger, NOT 0, as there are several other states not covered in the second trigger example, I could create multiple OR expressions to check the other states but would look a little untidy.

        Best Regards,

        Tony.
        Well, avg will be different from 0 as soon as a single value is greater than 0.
        You should use:
        {Template_WES:service_state[STEMDASH].min(300)}#0
        It will be equal to 0 until ALL values are non 0.

        In case your value could not only increase but also decrease, it is is a little more tricky:
        {Template_WES:service_state[STEMDASH].count(#N,0,"ne")}=N
        Were N is the number of samples you take into account.
        N depends on item polling period. If you are polling every 30 s, N should be 10.

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

        Comment

        • TonyW
          Junior Member
          • Jul 2010
          • 3

          #5
          Thanks alixen,

          Works perfectly, using {Template_WES:service_state[STEMDASH].count(#10,0,"ne")}=10 with a 30 second sampling of item.

          Best Regards,

          Tony.

          Comment

          Working...