Hello all
I have host defined in the hosts.cfg with the following timeperiod. Basically for testing I don't want any notification from this server. However I am still receiving emails when there is a issue on the host web1-udev.
Please help me I have tried a lot. May be I am missing something.
define timeperiod{
timeperiod_name no-notification
alias No Notification
sunday 00:00-24:00 ; Every Sunday of every week
monday 00:00-00:00 ; Every Monday of every week
tuesday 00:00-00:00 ; Every Tuesday of every week
wednesday 00:00-00:00 ; Every Wednesday of every week
thursday 00:00-00:00 ; Every Thursday of every week
friday 00:00-00:00 ; Every Friday of every week
saturday 00:00-24:00 ; Every Saturday of every week
define host{
name linux-box-nonimp ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period no-notification
notification_interval 10
notification_options d,r
contact_groups offpeak-contact-admins
register 0 ; DONT REGISTER THIS IS A TEMPLATE
}
define host{
use linux-box-nonimp ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name web1-udev
alias Web
address 192.168.16.231
check_period no-notification
}
Timeperiod not working
Re: Timeperiod not working
You should be able to add the following to your host directive:
Code: Select all
notifications_enabled 0Re: Timeperiod not working
I just want to set the notification (time period) to the host to be sent only during workhours.
Please tell me if this is correct.
vi hosts.cfg
define host{
name linux-box-nonimp ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period no-notification
notification_interval 10
notification_options d,r
contact_groups offpeak-contact-admins
register 0 ; DONT REGISTER THIS IS A TEMPLATE
}
define host{
use linux-box-nonimp ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name web1-udev
alias Web Server
address 192.168.16.231
check_period workhours
}
vi timeperiod.cfg
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 06:00-17:00
}
vi services.cfg
define service{
use local-service
host_name web1-udev
service_description Check SSH
check_command check_nrpe!check_ssh
check_period workhours
}
Please tell me if this is correct.
vi hosts.cfg
define host{
name linux-box-nonimp ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period no-notification
notification_interval 10
notification_options d,r
contact_groups offpeak-contact-admins
register 0 ; DONT REGISTER THIS IS A TEMPLATE
}
define host{
use linux-box-nonimp ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name web1-udev
alias Web Server
address 192.168.16.231
check_period workhours
}
vi timeperiod.cfg
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 06:00-17:00
}
vi services.cfg
define service{
use local-service
host_name web1-udev
service_description Check SSH
check_command check_nrpe!check_ssh
check_period workhours
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Timeperiod not working
pch wrote:Basically for testing I don't want any notification from this server
This timeperiod definition is not correct.pch wrote:define timeperiod{
timeperiod_name no-notification
alias No Notification
sunday 00:00-24:00 ; Every Sunday of every week
monday 00:00-00:00 ; Every Monday of every week
tuesday 00:00-00:00 ; Every Tuesday of every week
wednesday 00:00-00:00 ; Every Wednesday of every week
thursday 00:00-00:00 ; Every Thursday of every week
friday 00:00-00:00 ; Every Friday of every week
saturday 00:00-24:00 ; Every Saturday of every week
http://nagios.sourceforge.net/docs/3_0/ ... timeperiod
So your definition should be:If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.
Code: Select all
define timeperiod {
timeperiod_name no-notification
alias No Notification
} In that case it would be something like:pch wrote:I just want to set the notification (time period) to the host to be sent only during workhours.
Code: Select all
define timeperiod {
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 09:00-17:00
} As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.