Page 1 of 1

Error: Template '' specified in service definition could not

Posted: Mon Dec 18, 2017 10:30 am
by aamstutz
About a week after our upgrade to Nagios XI 5.4.11 and trying to apply changes from a template.
Attempt to restore from previously good config did not resolve the issue.

Unable to apply getting the following Output from the apply process:

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Template '' specified in service definition could not be not found (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting on line 140)
Error: Template '' specified in service definition could not be not found (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting on line 398)
Error: Template '' specified in service definition could not be not found (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting on line 726)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 11:38 am
by npolovenko
Hello, @aamstutz. It's hard to tell whats wrong without seeing the config files. Could you send in your Nagios XI System Profile so I can review it?
To send us your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it with your next post. Or you may upload the profile to a cloud storage of your choice and share a download link with me in pm.

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 1:42 pm
by aamstutz
current profile attached.

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 2:29 pm
by dwhitfield
I cannot say with any certainty, but it looks like you may be confused between service templates and services.

Is anyone in your org editing the config files by hand? Your configs definitely look strange, and it's possible this is one reason.

The following service template is being added to pretty much ever other service template. Is that what you want? It wouldn't be that odd, I suppose, except that's the name of one of your hosts.

Code: Select all

define service {
       name                          		tcdb10.lweng.com
       service_description           		Check Mate Service (ACommServer.exe)
       check_command                 		check_xi_service_nsclient!testing!PROCSTATE!-l acommserver.exe!-d SHOWALL!!!!
       max_check_attempts            		5
       check_interval                		5
       retry_interval                		1
       check_period                  		xi_timeperiod_24x7
       parallelize_check             		1
       notification_interval         		60
       notification_period           		xi_timeperiod_24x7
       register                    		0

}

The following service is also being added, which overlaps pretty significantly with the template.

Code: Select all

define service {
	host_name			tcdb10.lweng.com
	service_description		Check Mate Service ACommServer.exe
	check_command			check_xi_service_nsclient!testing!PROCSTATE!-l acommserver.exe!-d SHOWALL!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	notifications_enabled		1
	contacts			aamstutz,ksmyth,sportwoo
	register			1
	}	
You might want to go back to a config from the one before last if the last known good config did not resolve the issue.

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 3:27 pm
by aamstutz
Thanks for your reply. We are only editing through the Nagios XI GUI. I removed the incorrectly added Service Template for TCDB10. This was intended to add a service but someone new to the system added it as a Service Template. However, even after this change I still get the same error when trying to apply the config changes.

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 3:57 pm
by aamstutz
I was able to get a successful posting of a config with the following changes:
1. TCDB10 was incorrectly added as a Service Template. Removed
2. xiwizard_generic_service Service Template was incorrectly disabled. Re-enabled.
3. Ping service "Back of Building N double door Arecont 8185DN 65170.5.0" existed but host no longer existed. (172.32.96.106) - removed service
3. Ping service "Plant 2 MDF Switch 1 - Extreme Summit 300-48 POE" existing but host no longer existed. (172.25.32.15) - removed service

Re: Error: Template '' specified in service definition could

Posted: Mon Dec 18, 2017 4:39 pm
by dwhitfield
aamstutz wrote:I was able to get a successful posting of a config with the following change
It sounds like everything is good to go. Is that correct?

Re: Error: Template '' specified in service definition could

Posted: Tue Dec 19, 2017 9:16 am
by aamstutz
yes. This topic can be closed. Thanks.