I’m trying to set up certain notifications that aren’t really important enough to wake up in the middle of the night but I’d like to get to first thing in the morning. If a service flips to ‘warning’ state and it is at night, I’d like a notification first thing in the morning. Furthermore, I’d like to automatically reset the state of the service to ‘OK’ immediately after the notification.
In other words, I’d like nagios to watch for a condition over night and send a single notification in the morning if it has occurred and not have to worry about resetting the state back to ok.
I was thinking I would implement this using a passive check… But I have not been able to get it to work properly. Does anyone have any tips? Thanks.
Edit: I just got very, very close by making the service a volatle one… The status of it gets reset how I want. However, when the first check happens, the service goes from warning to OK and I don’t seem to be able to get a notification.
I think I’ve got a pretty good solution for this using normal unix ‘at’. I set up my service with the following:
I think that’s all that is important. Then I copied the service and host email commands and at the end of the command I put:
| at $NEXTVALIDTIME:wakehours$
…my theory is that notifications will go out from Nagios as normal; even a five minute ‘flip’ that resets before daylight. However, the notifications will sit in the at queue if it is night, and go out right away if it is day.
I’ll tell you if it works with another edit.