Hi all,
I've got a service check which reads from a log4net database and reports back on matching rows indicating a particular error. A column from the row (job number) is returned in the notification as status information ($SERVICEOUTPUT$). I encountered behaviour today in which one row is returned, triggering a CRITICAL status change and a notification. However, immediately after resolving this, another row is generated from a new error. The status information changes, as it's a new job number, but the status is still CRITICAL, so no new notification is issued. Aside from configuring periodic repeat notifications, can I trigger additional notifications on a status information change?
Notification when Status Information (not status) changes
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Notification when Status Information (not status) change
No, because it is the state of the service that triggers when it changes from OK / WARNING / CRITICAL / UNKNOWN. Just because the wording of the status changes does not make any difference if the service is already in a hard critical state. When it sends it's next notification the updated text will be sent in the notification.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Notification when Status Information (not status) change
You can cheat and make the service trigger an event handler, pass the state and status to the event handler which saves the last copy of the status information somewhere (temp file) and compares the new status to the old status. If it's not the same, then send an email. This way, Nagios still does the scheduling, but you're doing an end run around the notification logic.
Re: Notification when Status Information (not status) change
That's brilliant and looks like exactly what I need. Thank you so much!eloyd wrote:You can cheat and make the service trigger an event handler, pass the state and status to the event handler which saves the last copy of the status information somewhere (temp file) and compares the new status to the old status. If it's not the same, then send an email. This way, Nagios still does the scheduling, but you're doing an end run around the notification logic.
Re: Notification when Status Information (not status) change
Well, I wouldn't say it's "brilliant" exactly. "Stunning," maybe.
Let me know if you need help.
Let me know if you need help.
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Notification when Status Information (not status) change
You could also set the service to have isvolatile on. However it should be noted this will send on every warning\critical result not just when the status messages change. Otherwise I'd agree that eloyd's idea sounds like a pretty killer way of handling it.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Notification when Status Information (not status) change
No, "killer" would be to have the event handler figure out if it should notify, and then send the command back to the Nagios command pipe to do the notification. That would be killer.
Re: Notification when Status Information (not status) change
Proper "Killer" would entail the Pony Express, electrodes, Clint Eastwood, and lasers.
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.