I want to check a service 24×7, but want to check certain thresholds only during business hours. I could use check_period, but that would mean that the services aren't checked outside business hours. Alternatively I could use notification_period, but that will mean that when the notification_period starts, any alerts will be sent then, and I don't want that.
Is there any way of achieving this with Nagios 3 (actually I'm using icinga)?
Best Answer
I can think of two ways to do this: (a) use an external command to change the check command (Nagios calls this "adaptive monitoring") or (b) split the service into two with different check commands and periods.
I'll use
check_load
as and example with these (skeletal) service and command definitions:For (a) suppose you wish to change these values at 8pm return them at 8am. In cron add
where
change_load_check
isYou need to have external commands enabled.
For (b) you would take the original service, turn it into a template, and create two new services that specify different periods and check commands like so: