I'm upgrading from Nagios Core 3.4.4 to Nagios Core 4.0.2. The install itself went fine, but when I attempt to start, I am getting this error about my template.cfg file:
Error: Service has no hosts and/or service_description
Here's part of my template.cfg:
Code: Select all
define service {
name base-service
use generic-service
contact_groups OPS
notification_interval 60 ; in minutes
register 0 ; don't register - this is just a template
check_period 24x7
notification_period 24x7
}
define service {
name 1-min-int
use base-service
normal_check_interval 1
retry_check_interval 1
max_check_attempts 2
notification_options w,u,c,r
}
And indeed, when I add the register variable to all of my templates, Nagios does not error and starts.This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the register directive to be 0. This prevents the need to override an inherited register directive with a value of 1 for every object that should be registered.
Looking through the changelog, it doesn't make sense to me why the previous template.cfg was working with Nagios 3.4.4, as I'm not able to find any documentation on this.
Thoughts?
Thank you.