Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
My goal is to have notifications for a specific host be sent out only during the hours of 6AM est and 5pm est, Monday through Friday. All other hours will not send any alerts. I have defined the following timeperiod in timeperiods.cfg
define host{
use linux-server
host_name testserver
alias teserver
address x.x.x.x
hostgroups linux
max_check_attempts 2
notification_interval 30
notification_period test-uptime
hostgroups testgroup
contacts blah
}
As I was going through the configs accumulating the information, I may have realized my error. Do I need to define the notification_period for each specific service that is being checked?
Also, if do need to add notification_period for the specific servers, how would I then only do it for one specific server in a hostgroup. Would I need to create a separate service check separate from the hostgroup for that one host?
and1100 wrote:Do I need to define the notification_period for each specific service that is being checked?
Only if you need to override host/template settings, otherwise you could set the timeperiod on the host or on the template.
and1100 wrote:Would I need to create a separate service check separate from the hostgroup for that one host?
Not necessarily. Settings on the object itself will override settings on the hostgroup/etc. Basically, the closer you are to the host/service object, the higher precedence your settings take.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Thank you for the response and information. I have set the timeperiod on the host definition but I still seem to be receiving the alerts when I'd like them to be suppressed.
I double checked the configuration in the GUI has well and it looks to have stuck for the host:
Time Period test-uptime
Name Alias/Description Exclusions Days/Dates Times
test-uptime test Uptime Hours december 25 00:00:00 - 00:00:00
july 4 00:00:00 - 00:00:00
january 1 00:00:00 - 00:00:00
thursday 4 november 00:00:00 - 00:00:00
monday 1 september 00:00:00 - 00:00:00
monday -1 may 00:00:00 - 00:00:00
monday 06:01:00 - 17:00:00
tuesday 06:01:00 - 17:00:00
wednesday 06:01:00 - 17:00:00
thursday 06:01:00 - 17:00:00
friday 06:01:00 - 17:00:00
Are you just testing this with the host? You will want to assign the time period to either your services, or your contact(s)/groups that are assigned to them as well to suppress those notifications.