Template not not found


#1

Hello.
I am trying to add a service when I get an error, complaining that it cannot find the template. I cannot see what I have missed here, perhaps someone here knows?
I have added them in cfg-files in ‘/etc/icinga/objects/’.
’/etc/icinga/objects/check_apachelogs.cfg’define service { service_description check_apachelogs host_name winserver check_command check_nrpe_1arg!check_logfiles use logfilescan }
’/etc/icinga/objects/logfilescan.cfg’define service { service_description logfilescan register 0 is_volatile 1 check_period 7x24 max_check_attempts 1 use generic-service }
It is processing the files when I run the configuration check.[code]ej@ubuntu:~$ sudo /usr/sbin/icinga -v /etc/icinga/icinga.cfg

Icinga 1.2.1

Reading configuration data…
Read main config file okay…
Processing object config file ‘/etc/icinga/commands.cfg’…
Processing object config directory ‘/etc/nagios-plugins/config’…

Processing object config file ‘/etc/nagios-plugins/config/check_nrpe.cfg’…
Processing object config directory ‘/etc/icinga/objects’…
Processing object config file ‘/etc/icinga/objects/hostgroups_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/windows.cfg’…
Processing object config file ‘/etc/icinga/objects/templates.cfg’…
Processing object config file ‘/etc/icinga/objects/timeperiods_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/logfilescan.cfg’…
Processing object config file ‘/etc/icinga/objects/check_apachelogs.cfg’…
Processing object config file ‘/etc/icinga/objects/extinfo_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/generic-host_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/generic-service_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/localhost_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/contacts_icinga.cfg’…
Processing object config file ‘/etc/icinga/objects/services_icinga.cfg’…
Error: Template ‘logfilescan’ specified in service definition could not be not found (config file ‘/etc/icinga/objects/check_apachelogs.cfg’, starting on line 1)
Error processing object config files!

***> The name of the main configuration file looks suspicious…

 Make sure you are specifying the name of the MAIN configuration file on
 the command line and not the name of another configuration file.  The
 main configuration file is typically '/usr/local/icinga/etc/icinga.cfg'

***> 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 definitions.  If you are upgrading from a previous
 version of Icinga, 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.[/code]

Any ideas?
I also wonder how it can complain about the main configuration file name, since it in Icinga checks whether it is named nagios.cfg or icinga.cfg?
Thanks.


#2

in your service definition you say
use logfilescan
that’s a template nagios is looking for and can’t find it.