Page 1 of 1

Service has no hosts and/or service_description (config file

Posted: Wed Feb 19, 2020 11:59 am
by yellowdog
Hello,

I have installed a fresh NAGIOS Core server 4.4.5 and begin to transfer the CFG files from my old FAN distrib.
But I have an error with my templates.cfg
The following message appears when checking the configuration:

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/objects/templates.cfg', starting on line 622)
The definition is correct and works fine for ages on the FAN. If I remove this define service in the templates.cfg, it generates an error on an other define service and so on.

Code: Select all

define service{
        name                     decisionnel-service
        use                      generic-service
        max_check_attempts       3
        check_interval           3
        notification_interval    240
        retry_interval           1
        contact_groups           Decisionnel
        }
Thanks a lot for your help.

Re: Service has no hosts and/or service_description (config

Posted: Wed Feb 19, 2020 12:04 pm
by scottwilkerson
You need to add the following to the definition because it is a template

Code: Select all

register                        0

Re: Service has no hosts and/or service_description (config

Posted: Thu Feb 20, 2020 3:09 am
by yellowdog
Thanks a lot, it's working fine now.

Re: Service has no hosts and/or service_description (config

Posted: Thu Feb 20, 2020 7:58 am
by scottwilkerson
yellowdog wrote:Thanks a lot, it's working fine now.
Great!

Locking thread