Page 1 of 2
notification_interval based on severity
Posted: Tue Feb 12, 2013 1:23 pm
by retlaw
Hi,
New here, so be gentle.
I've setup the check_printer to monitor the status of supplies (toner) on a printer.
I am currently getting the notification sent once a day.
What I would like is to only receive the notifications daily if the severity is critical, and if the severity is warning receive them once a week (if I could have that be Monday, that would be a bonus).
Any ideas on how to accomplish this?
thanks
Re: notification_interval based on severity
Posted: Tue Feb 12, 2013 2:31 pm
by lmiltchev
I haven't tested this, but this may be possible by doing the following:
1. Create two different timeperiods, for example:
Code: Select all
define timeperiod {
timeperiod_name printer-critical
alias 24 Hours A Day, 7 Days A Week
saturday 00:00-24:00
friday 00:00-24:00
thursday 00:00-24:00
wednesday 00:00-24:00
tuesday 00:00-24:00
monday 00:00-24:00
sunday 00:00-24:00
}
define timeperiod {
timeperiod_name printer-warning
alias printer-warning
monday 00:00-24:00
}
2. Define two different service checks (I don't know if this can be done with one check only; if anyone knows, please, let me know) that use these timeperiods.
In the first check, you might have these lines:
Code: Select all
...
service_description Printer Status - warning
notification_period printer-warning
notification_options w,
...
In the second one:
Code: Select all
...
service_description Printer Status - critical
notification_period printer-critical
notification_options c,
...
Again, I haven't tested it - please, let me know if it works for you.
BTW, if your check gets a warning state on Tuesday, are you going to be OK with receiving a notification in a week on Monday?
Re: notification_interval based on severity
Posted: Tue Feb 12, 2013 3:43 pm
by retlaw
I'll see what I can do with your suggestions.. maybe a feature request to have it be all in one service check?
And, YES I would be OK with waiting a week to get notified of a warning.. it's just to monitor toner levels, and we go about 4 months between replacements, and I just want to make sure that I can order it before we run out if someone took the spares without letting me know.
thanks.
Re: notification_interval based on severity
Posted: Tue Feb 12, 2013 3:57 pm
by retlaw
OK, I did that and I'll have to see if it works as expected... however, I now have two status entries for the printer supplies in the web interface, which is confusing.. so, I'm guessing my idea of a feature request is the direction I would prefer.. but then, beggars can't be choosers.
I'll report back next week (or sooner) with the results.
again, thanks
Re: notification_interval based on severity
Posted: Tue Feb 12, 2013 4:25 pm
by lmiltchev
Thanks for the feedback! I will try to come up with a "one-check" solution even though, at the moment, I don't see how this can be done.
Re: notification_interval based on severity
Posted: Wed Feb 13, 2013 5:09 am
by gshergill
Hi lmiltchev,
Could you not use a service escalation?
So the standard service just uses;
Code: Select all
...
notification_period printer-warning #Where this is set to weekly
notification_options w, c
...
And the escalation uses;
Code: Select all
...
first_notification 1
last_notification 0
notification_interval 1440
escalation_options c
...
Might be a few things I'm overlooking though...
-> By setting first_notification to 1, it only happens with the first escalation_options notification?
-> It would probably send out a double notification for critical, unless you can set first_notification to 0?
Anyways, just thought I'd throw this out there, hopefully it's useful =)
Kind Regards,
Gary Shergill
Re: notification_interval based on severity
Posted: Wed Feb 13, 2013 12:43 pm
by abrist
gshergill wrote:
Might be a few things I'm overlooking though...
-> By setting first_notification to 1, it only happens with the first escalation_options notification?
-> It would probably send out a double notification for critical, unless you can set first_notification to 0?
By setting first notification to 1 you will essentially escalate on the first alert. It will only send out a double critical if the contact is a contact on the host/service
and the escalation.
Re: notification_interval based on severity
Posted: Thu Feb 14, 2013 4:39 am
by gshergill
Hi abrist,
By setting first notification to 1 you will essentially escalate on the first alert.
The first Alert of any kind? Or the first alert the escalation is for? i.e. setting the service to WARNING,CRITICAL and the escalation to just CRITICAL, would it only do the escalation on the first CRITICAL alert?
If so, this might be an option for notification_interval based on severity.
Kind Regards,
Gary Shergill
Re: notification_interval based on severity
Posted: Thu Feb 14, 2013 11:54 am
by abrist
gshergill wrote:
The first Alert of any kind? Or the first alert the escalation is for? i.e. setting the service to WARNING,CRITICAL and the escalation to just CRITICAL, would it only do the escalation on the first CRITICAL alert?
It will be the first alert that the escalation is set for. So the first time the box goes critical the escalation will fire off.
Re: notification_interval based on severity
Posted: Fri Feb 15, 2013 4:30 am
by gshergill
Hi abrist,
Code: Select all
It will be the first alert that the escalation is set for. So the first time the box goes critical the escalation will fire off.
That's great, I'd recommend giving this a go then retlaw, it could solve your question, unless lmiltchev found a better solution?
Kind Regards,
Gary Shergill