Nagios notification_interval knowing previous state
Posted: Mon Feb 06, 2017 12:39 pm
Is there any functionality in Nagios Core so that when a service or host alarms, and notification goes out, that if that server/host stays in a Critical or Warning state, that when the notification_interval comes up again for notification, that it can know it was already in that state previously?
Let me explain this a little better. Say a root filesystem service check on hostX goes critical at 01:00. The notification goes out, of whichever method I prefer. The notification_interval is set to say 1440 (1 day) and then at 01:00 the following day, another notification goes out. It goes out again because the state of that service/host hasn't gone OK (recovery). Can that second notification include some kind of parameter that I can script against that will let me know this is still in an unresolved Critical/Warning state?
If not, then I can simply script around it so that my notification script keeps a property file of sorts and then 1440 minutes later, if the property file still contains data, i know it's the 2nd or more occurrence. If a recovery occurs, I can remove that entry from my property file. This does seem like extra coding that if it is possible without and a parameter knows this; I'd love to KISS, so to speak.
Thanks.
Let me explain this a little better. Say a root filesystem service check on hostX goes critical at 01:00. The notification goes out, of whichever method I prefer. The notification_interval is set to say 1440 (1 day) and then at 01:00 the following day, another notification goes out. It goes out again because the state of that service/host hasn't gone OK (recovery). Can that second notification include some kind of parameter that I can script against that will let me know this is still in an unresolved Critical/Warning state?
If not, then I can simply script around it so that my notification script keeps a property file of sorts and then 1440 minutes later, if the property file still contains data, i know it's the 2nd or more occurrence. If a recovery occurs, I can remove that entry from my property file. This does seem like extra coding that if it is possible without and a parameter knows this; I'd love to KISS, so to speak.
Thanks.