notification_interval based on severity
notification_interval based on severity
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
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
I haven't tested this, but this may be possible by doing the following:
1. Create two different timeperiods, for example:
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:
In the second one:
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?
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
}In the first check, you might have these lines:
Code: Select all
...
service_description Printer Status - warning
notification_period printer-warning
notification_options w,
...Code: Select all
...
service_description Printer Status - critical
notification_period printer-critical
notification_options c,
...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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: notification_interval based on severity
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.
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
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
I'll report back next week (or sooner) with the results.
again, thanks
Re: notification_interval based on severity
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: notification_interval based on severity
Hi lmiltchev,
Could you not use a service escalation?
So the standard service just uses;
And the escalation uses;
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
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
...Code: Select all
...
first_notification 1
last_notification 0
notification_interval 1440
escalation_options c
...-> 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
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.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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: notification_interval based on severity
Hi abrist,
If so, this might be an option for notification_interval based on severity.
Kind Regards,
Gary Shergill
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?By setting first notification to 1 you will essentially escalate on the first alert.
If so, this might be an option for notification_interval based on severity.
Kind Regards,
Gary Shergill
Re: notification_interval based on severity
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.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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: notification_interval based on severity
Hi abrist,
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
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.Kind Regards,
Gary Shergill