ZABBIX Forums  

Go Back   ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Help

Reply
 
Thread Tools Display Modes
  #1  
Old 15-10-2008, 19:25
stever stever is offline
Member
 
Join Date: Jun 2006
Posts: 36
Default 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 at 19:41.
Reply With Quote
  #2  
Old 20-10-2008, 18:57
alixen alixen is offline
Senior Member
 
Join Date: Apr 2006
Location: Paris, France
Posts: 462
Default

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
Reply With Quote
  #3  
Old 20-10-2008, 19:49
stever stever is offline
Member
 
Join Date: Jun 2006
Posts: 36
Default

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
Reply With Quote
  #4  
Old 17-08-2011, 12:34
sevan sevan is offline
Junior Member
 
Join Date: Aug 2011
Posts: 11
Default 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.
Reply With Quote
  #5  
Old 17-08-2011, 16:54
harmonica harmonica is offline
Senior Member
 
Join Date: Jan 2009
Location: Portugal, Lisbon
Posts: 220
Send a message via MSN to harmonica
Default

Hello,

Means that the trigger is activated only from 10h: 46m: 00s until 10h: 48m: 00s

Last edited by harmonica; 18-08-2011 at 10:07.
Reply With Quote
  #6  
Old 18-08-2011, 06:33
sevan sevan is offline
Junior Member
 
Join Date: Aug 2011
Posts: 11
Default timer

104600 means 10:46:00 or 18:46:00?
Reply With Quote
  #7  
Old 18-08-2011, 10:06
harmonica harmonica is offline
Senior Member
 
Join Date: Jan 2009
Location: Portugal, Lisbon
Posts: 220
Send a message via MSN to harmonica
Default

Sorry, my mistake.
Yes, 10h: 46m: 00s until 10h: 48m: 00s
Reply With Quote
  #8  
Old 20-08-2011, 06:32
sevan sevan is offline
Junior Member
 
Join Date: Aug 2011
Posts: 11
Default 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,
Reply With Quote
  #9  
Old 28-08-2011, 03:23
delatbabel delatbabel is offline
Junior Member
 
Join Date: Aug 2011
Posts: 7
Default

Quote:
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)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:30.