Page 1 of 1

Error: Service has no hosts and/or service_description (conf

Posted: Thu Dec 01, 2016 6:21 pm
by nthaler
Hello Nagios!

I am currently unable to apply any new configurations to our Nagios-xi instance. I am repeatedly getting the same error, no matter the change I try to make. The changes I am trying to make have nothing to do with the services associated with the file hwmaint54.cfg.

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/hwmaint54.cfg', starting on line 173)

When I vi /usr/local/nagios/etc/services/hwmaint54.cfg every service appears to be correctly configured.

We are running NagiosXI 5.2.9 with the Database offloaded to a separate machine.

I have tried the following.
Rolling back to a listed previous good configuration. I get the same error when I apply the supposedly previous good configuration.
restarting the nagios engine
stopping the engine>stopping the database>starting the database>starting the engine
running the /usr/local/nagiosxi/scripts/repairmysql.sh script

Please help me figure this out as we cannot remove or add checks currently.

Thank you

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

Posted: Thu Dec 01, 2016 6:46 pm
by jwelch
Just a suggestion. I'd try moving the /usr/local/nagios/etc/services/hwmaint54.cfg
out of the way (like in /tmp) and apply the config and see if a new one gets built.
If that doesn't help, I'd try deleting the services and host completely and apply the config.
If that works, then re-add the host and services using the gui.

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

Posted: Fri Dec 02, 2016 10:25 am
by rkennedy
Thanks @jwelch! This is a good step if the corruption is possibly in the database. The 'Write Config Files' tool in the CCM does essentially, this when you run a delete -> write -> verify.

Could you post /usr/local/nagios/etc/services/hwmaint54.cfg for us to look at?
The changes I am trying to make have nothing to do with the services associated with the file hwmaint54.cfg.
If previous changes were incorrect, Nagios will still try to validate them.

Another thing I've seen in the past, is when the time betwee the XI machine and offloaded DB do not match up. Could you run this on both machines and verify the time is lining up between system / php / mysql? (some will fail which is fine, we will need to see the time SQL is running though)

Code: Select all

grep "date.timezone" /etc/php.ini
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
date
mysql -unagiosxi -pn@gweb -e "SELECT NOW();"

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

Posted: Tue Dec 06, 2016 12:01 pm
by nthaler
Thanks for all the help.

I ended up having to delete all the services and host and recreating them to get it to work in the end.

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

Posted: Tue Dec 06, 2016 12:29 pm
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!