Page 1 of 1

Service Not Inheriting from Service Template

Posted: Tue Oct 30, 2018 3:22 pm
by MikeMAN987
Hello,

Previously have used this template in a lot of places, but I have a few cases where my services don't appear to be working:

Attached Files -
test_service_template.cfg - Service Template
test_service.cfg - Service


Error: notification_period '' for service 'CPU' on host 'redacted' could not be found!
Error: Could not register service (config file '/usr/local/nagios/etc/services/hg0-mgicint-linux-ts.cfg', starting on line 16)

The notification period is defined in the template, and on the "service template" tab of the service I have selected the Test template.

Curious what I am missing here. Also, if I am correct in my thinking, anything we define on the service itself (more specific parameters) will override anything inherited from the template.

Thanks for any insight!

Re: Service Not Inheriting from Service Template

Posted: Tue Oct 30, 2018 4:12 pm
by tgriep
What is happening it that for the service, the notification_period option is defined in the check but it does not have a period set.
When you setup an option in the object (The Service Check) even though it is blank, it will not inherit the settings from the template and that is causing your errors.
What you need to do is to edit the service checks and remove the notification_period from the services that are blank which will allow the template to set that option through inheritance.

Re: Service Not Inheriting from Service Template

Posted: Wed Oct 31, 2018 2:58 pm
by MikeMAN987
Thanks for the insight. I suspected that was the case (mostly because the error message says that), however when managing these configurations through the GUI, how can I update these settings to be "truly" blank? right now the GUI shows no notification period, yet the .cfg file shows the setting but without a value.

Regards,
Mike

Re: Service Not Inheriting from Service Template

Posted: Wed Oct 31, 2018 3:20 pm
by tgriep
I would guess that there was an issue what the checks were created or edited and those options did not get set.
Try this, In the Core Config Manager, edit those services and add a Notification Period. Save it. Then remove it and Save it.
Are they gone then?

Re: Service Not Inheriting from Service Template

Posted: Wed Oct 31, 2018 3:53 pm
by MikeMAN987
That worked great, thank you very much! ( I used the bulk modification tool to add a check period and then remove the same one)

Re: Service Not Inheriting from Service Template

Posted: Wed Oct 31, 2018 3:56 pm
by tgriep
Your welcome. Glad it worked. Let us know if you have any further questions or that it is OK to close and lock the post as solved.

Re: Service Not Inheriting from Service Template

Posted: Tue Nov 06, 2018 4:14 pm
by MikeMAN987
Feel free to close/lock. Thank you again!