I imagine this could be done w/ a bit of scripting and the new API, but an old time and blindingly simple way would be to define a pair of host template files w/ different values.
Have cron copy one into /usr/local/nagios/etc/import/ at the right time, then run the reconfig script from the right dir. Then at the right time another similar cron job copies the other to import and reconfigures.
Do the same w/ a pair of service templates.
This should take an hour or so to set up.
The reconfig imports the values, updates the templates, and applies the changes.
Of course, you need to update all your hosts and services to use templates, but that too can be done via an import, and probably better via the API.
Examples templates
Code: Select all
define host {
name base_host
alias Template containing notification and check intervals. Used by templates
check_command check_ping!3000.0,80%!5000.0,100%!!!!!!
max_check_attempts 4
check_interval 5
retry_interval 1
check_period 24x7
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 60
notification_period 24x7
first_notification_delay 15
register 0
}
Code: Select all
define service {
name base_service
service_description Base service sourced by others
display_name Base template for most templates
is_volatile 0
max_check_attempts 4
check_interval 5
retry_interval 1
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
parallelize_check 1
obsess_over_service 0
check_freshness 0
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 60
first_notification_delay 15
notification_period 24x7
notification_options w,c,u,
register 0
}