周一到周末Nagios notification_interval

我想configurationNagios从周一到周五每6小时发送一次页面,但周六和周日每24小时只发一次。 如何让一组pipe理员拥有两个不同的寻呼频率,我正在困难的思考。

这是一个例子,如何做,但我希望有人有一个更好的方法。 定义你的服务工作日:

define service{ name foo-weekday host_name linux-server service_description check-disk-sda1-weekday check_command check-disk!/dev/sda1 max_check_attempts 5 check_interval 5 retry_interval 3 check_period weekday notification_interval 360 notification_period weekday notification_options w,c,r contact_groups linux-admins } 

然后inheritance它,覆盖周末的check_period,notification_interval,notification_period和service_description(它必须是唯一的每个主机):

 define service{ name foo-weekend use foo-weekday service_description check-disk-sda1-weekend check_period weekend notification_interval 1440 notification_period weekend } 

编辑:我不知道用户macros是否会在这种情况下工作? 例如,只有1个服务定义:

 define service{ host_name linux-server service_description check-disk-sda1 check_command check-disk!/dev/sda1 max_check_attempts 5 check_interval 5 retry_interval 3 check_period 24x7 notification_interval $USER21$ notification_period 24x7 notification_options w,c,r contact_groups linux-admins } 

然后,有两个不同的资源文件。 一个定义USER21为“360”,一个定义为“1440”。 当周末开始复制后者,并重新加载nagiosconfiguration。 当周末结束时复制前者并重新加载。