You helped me out immensely. I was completely unaware of the 'verification' command and hadn't been seeing the error messages that specified what part of my config files were botched. Using the verification command helped me pinpoint the problem here. For the benefit of future visitors to this thread, I'll clarify the problem and solution.
Within timeperiods.cfg, there are example definitions. Not all of them use the same fields in their format. For example, 24x7 is missing the 'name' field:
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
}
While workhours has the name field:
Code: Select all
define timeperiod{
name workhours
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
}
Two problems I was running into here:
1. You cannot reference multiple time periods within a contact
as in:
Code: Select all
host_notification_period workhours,24x7
service_notification_period workhours,24x7
You have to create a custom time period that combines the multiple time periods, then reference that in your contact definition.
From timeperiods.cfg:
Code: Select all
define timeperiod{
name scott_oncall
timeperiod_name scott_oncall
alias Scott on call
use workhours,my_monday,second_weekend
}
From contacts.cfg:
Code: Select all
define contact{
contact_name Scott
use generic-contact
alias Scott Edwards
email sedwards@company.com
service_notification_options c,r
host_notification_period scott_oncall
service_notification_period scott_oncall
}
2. When referencing a defined time period in contacts.cfg file or timeperiods.cfg, you have to use the 'name' value. The 'timeperiod_name' cannot be used. If the 'name' isn't present in the definition, as is the case with 24x7, you have to add it.
Finally, here's the verification syntax I used on our Fedora Nagios install:
Code: Select all
/usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
Thanks a lot!
mtf