Code: Select all
define host {
use server
address 192.168.1.34
host_name myserver
hostgroups linux,database
notification_period downtime
}Code: Select all
define host {
use server
address 192.168.1.34
host_name myserver
hostgroups linux,database
notification_period downtime
}Code: Select all
define timeperiod {
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
define timeperiod {
timeperiod_name downtime
alias Downtime
sunday 02:00-03:00
monday 02:00-03:00
tuesday 02:00-03:00
wednesday 02:00-03:00
thursday 02:00-03:00
friday 02:00-03:00
saturday 02:00-03:00
}Code: Select all
now_epoch=$(eval date +%s); start_epoch=$(date +'%F 15:00:00' | xargs -0 date +%s -d); end_epoch=$(date +'%F 16:00:00' | xargs -0 date +%s -d); printf "[$now_epoch] SCHEDULE_HOST_DOWNTIME;centos01;$start_epoch;$end_epoch;1;0;;nagiosadmin;Daily Donwtime\n" > /usr/local/nagios/var/rw/nagios.cmd
now_epoch=$(eval date +%s); start_epoch=$(date +'%F 15:00:00' | xargs -0 date +%s -d); end_epoch=$(date +'%F 16:00:00' | xargs -0 date +%s -d); printf "[$now_epoch] SCHEDULE_HOST_SVC_DOWNTIME;centos01;$start_epoch;$end_epoch;1;0;;nagiosadmin;Daily Donwtime\n" > /usr/local/nagios/var/rw/nagios.cmd