Ad Widget

Collapse

Trigger - do not work in certain period

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onallion
    Senior Member
    • Mar 2016
    • 131

    #1

    Trigger - do not work in certain period

    Hey guys,

    For a certain host I want to change the trigger so it DOESN'T fire between a certain time (friday noon to sunday noon). I can't seem to find the right way to do this. Any suggestions/examples?
  • onallion
    Senior Member
    • Mar 2016
    • 131

    #2
    I did something like this to tell it when to trigger:

    Code:
    {host:icmpping.max(#4)}=0
    and {host:icmpping.dayofweek()}=1-4
    or ({host:icmpping.dayofweek()}=5 and {host:icmpping.time()}>000000 and {host:icmpping.time()}<120000) 
    or ({host:icmpping.dayofweek()}=7 and {host:icmpping.time()}>120000)
    But I'm sure there's a better way...

    Comment

    • batchenr
      Senior Member
      • Sep 2016
      • 440

      #3
      Originally posted by onallion
      Hey guys,

      For a certain host I want to change the trigger so it DOESN'T fire between a certain time (friday noon to sunday noon). I can't seem to find the right way to do this. Any suggestions/examples?
      you can add timing to your item -
      set "Type" instead of Zabbix Agent (Active) -> zabbix Agent
      and it will give you an option "Custom intervals" to set days and hours to test

      Comment

      • onallion
        Senior Member
        • Mar 2016
        • 131

        #4
        It's ping, so the item is "simple check". Also, I don't want to change the item, I want the item to keep working all the time, just the trigger to fire off at certain times.

        Comment

        • SBO
          Zabbix Certified Specialist
          Zabbix Certified Specialist
          • Sep 2015
          • 226

          #5
          I use this trigger to have it working from Mon to Fri, between 8:00am to 7:00pm

          Code:
          {MyHost:web.test.fail[some.web.site].last()}#0 & {MyHost:web.test.fail[some.web.site].dayofweek(0)}<6 & {MyHost:web.test.fail[some.web.site].time(0)}>080000 & {MyHost:web.test.fail[some.web.site].time(0)}<190000
          If I decompose the trigger :
          # My alert trigger
          {MyHost:web.test.fail[some.web.site].last()}#0

          &

          # Days / From Mon to Fri
          {MyHost:web.test.fail[some.web.site].dayofweek(0)}<6

          &

          # Only after 08:00:00am
          {MyHost:web.test.fail[some.web.site].time(0)}>080000

          &

          # Not after 07:00:00pm
          {MyHost:web.test.fail[some.web.site].time(0)}<190000


          Hope it can help you

          Comment

          Working...