there is a bug in CCM. The bug applies not only to contacts or templates as shown in this example.
Nagios version 5.2.8
To reproduce the problem:
Create a contact and assign the contact to a service check.
=> Apply Configuration => Everything should work.
Disable the contact
=> Apply Configuration
Code: Select all
Error: Contact 'Test' is not defined anywhere!
Error: Could not add contact 'Test' to service (config file '/usr/local/nagios/etc/services/testservice.cfg', starting on line 16)
Config file line 16:
contacts Test
Create a service template and assign the service template to a service. Add only one service template to the service.
=> Apply Configuration => Everything should work.
Disable the service template
=> Apply Configuration
Code: Select all
Error: Template 'local-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/services/localhost.cfg', starting on line 136)
Config file line 136:
use local-service
The workflow to check for an error is not very nice, to see the error in the configuration file you have to extract the tar.gz. file.
It would be much better if the configuration with the error is somehow readable by the web interface or at least easy visible using SSH.
For example this command will get the name of the config file from the log file.
Code: Select all
grep 'Error:.*config file ' /usr/local/nagiosxi/nom/checkpoints/nagioscore/errors/1465390852.txt | sed -e "s/.*(config file '//" -e "s/', starting.*//"