Announcement

Collapse
No announcement yet.

Any way to setup triggers for a certain time period?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Any way to setup triggers for a certain time period?

    I'm wondering if there is a way to setup triggers in zabbix to be dependent on the time period. I know this can be done with actions, but I'm wondering if there's any way to do so for a trigger. And if not, I would like to make that a feature request.

    Right now, I have the following setup:

    Triggers:
    - one trigger that triggers if we have no messages received in the last hour, i.e. messagerate.max(3600)<1
    - one trigger that triggers if we have no messages received in the last 12 hrs

    Actions:
    - alert on messages received in last hour trigger, Time period in "2-6,06:00-17:59"
    - alert on messages received in 12 hrs trigger, no time period restriction


    Currently, this covers what I'm going for, basically alerting only during weekday, working hours for the more sensitive trigger. However, it gets difficult to trace down these events using the event history, as throughout the off hours, the sensitive triggers are flapping constantly. Since we have 11 hosts based on this template, my event history is full of this sensitive trigger going on/off during off hours, and its tough to track down any real occurrences.

    Any ideas how to get around this? I'm thinking about writing a custom user-monitored value, and associated trigger to trigger during off hours. Then, by adding a dependency to these triggers, they won't trigger throughout the night.

    However, all this would be so much easier and more powerful if I were able to specify a trigger with a validity time period.

    ps - I am running zabbix 1.4.6, and have also tried this on my 1.6 test machine.
    Last edited by stever; 15-10-2008, 19:41.

    #2
    There is a time function that can be used for trigger evaluation.
    I have not used it yet but, according to Zabbix user manual, you could write something like:
    {host: param.time(0)} >= 06000 & {host: param.time(0)} < 180000

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

    Comment


      #3
      Great stuff, I just tested and it worked. This is the exact trigger expression I used, I figured icmpping was the easiest item to use the time expression on. I guess you could use the other time based items as well, i.e. dayofweek(), date(), now() as well.

      Code:
      {Template_VZ:icmpping. time( 0 ) }>104600 & {Template_VZ:icmpping. time( 0 ) }<104800

      Comment


        #4
        trigger time

        would you please explain more about the numbers and method in for the following expression:

        Template_VZ:icmpping. time( 0 ) }>104600 & {Template_VZ:icmpping. time( 0 ) }<104800

        In other word please explain the expression in words.

        Comment


          #5
          Hello,

          Means that the trigger is activated only from 10h: 46m: 00s until 10h: 48m: 00s
          Last edited by harmonica; 18-08-2011, 10:07.

          Comment


            #6
            timer

            104600 means 10:46:00 or 18:46:00?

            Comment


              #7
              Sorry, my mistake.
              Yes, 10h: 46m: 00s until 10h: 48m: 00s

              Comment


                #8
                zabbix trigger timer config

                I wanted to setup a trigger to be active 24 hours except the period of time for one hour between 2Am to 3AM, is this a correct expression:

                {server.01:ifHCOutOctets.10020.time(0)}>000000&{se rver.01:ifHCOutOctets.10020.time(0)}<020000&{serve r.01:ifHCOutOctets.10020.time(0)}>030001&{server.0 1:ifHCOutOctets.10020.time(0)}<240000

                please advise,

                Comment


                  #9
                  Originally posted by sevan View Post
                  I wanted to setup a trigger to be active 24 hours except the period of time for one hour between 2Am to 3AM, is this a correct expression:

                  {server.01:ifHCOutOctets.10020.time(0)}>000000&{se rver.01:ifHCOutOctets.10020.time(0)}<020000&{serve r.01:ifHCOutOctets.10020.time(0)}>030001&{server.0 1:ifHCOutOctets.10020.time(0)}<240000

                  please advise,
                  No, that doesn't look right to me.

                  Try this:

                  ({server.01:ifHCOutOctets.10020.time(0)}<020000|{s erver.01:ifHCOutOctets.10020.time(0)}>030001)

                  A similar trigger seems to work for me, getting alerted on CPU load except between 2am and 6am (backup window when the backup program can drive the CPU up):

                  {Template_Linux:system.cpu.load[,avg1].last(0)}>5&({Template_Linux:system.cpu.load[,avg1].time(0)}<020000|{Template_Linux:system.cpu.load[,avg1].time(0)}>060000)

                  Comment

                  Working...
                  X