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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nthaler
Posts: 35
Joined: Fri Jul 08, 2016 11:24 am

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

Post 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
jwelch
Posts: 225
Joined: Wed Sep 05, 2012 12:49 pm

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

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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();"
Former Nagios Employee
nthaler
Posts: 35
Joined: Fri Jul 08, 2016 11:24 am

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

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

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

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Locked