Error: Service has no hosts and/or service_description

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

Error: Service has no hosts and/or service_description

Post by valmberg »

Running Nagios XI in VMware.

After upgrading to Nagios 5.3.x, I am unable to successfully apply any configurations when I add/change services. No services work - no matter what I do. I have followed several threads and attempted to fix the problem. I am now down to having deactivated ALL of the services in Nagios - then I get no services defined error message.

I have also gone through all the steps of Config File Management (delete files, then write files, then verify files) and have gotten it to successfully verify. However, whenever I go to add a service - JUST ONE SERVICE, I get the error message: "Error: Service has no hosts and/or service_description..." If I remove the LAST service, I get an error saying there are no services configured.

Here is the full text of the message:

Code: Select all

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

Nagios Core 4.1.1 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-19-2015 
License: GPL 

Website: https://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Censdcprd1.cfg', starting on line 16) 
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. 
Please help. Up until now, Nagios XI has been very reliable and dependable. I have successfully upgraded and kept the server upgraded until the 5.3.x release. I have also tried to go into the Nagios XI customer forum, but it says I don't have access - even though we have support through Nagios.
Last edited by avandemore on Mon Nov 28, 2016 1:19 pm, edited 1 time in total.
Reason: Please use code tags for output.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

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

Post by avandemore »

Please go to XI > Configure > CCM > Configuration Snapshots > and find the most recent entry with "Config Ok". Click the Restore button for that line. Restore the snapshot then apply the configuration. Let us know if that helped.
Previous Nagios employee
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

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

Post by valmberg »

I tried that and it still is throwing errors when working with services. I still get the same error : "Error: Service has no hosts and/or service_description"

Code: Select all

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

Nagios Core 4.1.1 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-19-2015 
License: GPL 

Website: https://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Tilsdcprd1.cfg', starting on line 105) 
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. 

And here is the Tilsdcprd1 config file:

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.2
# Date:	      2016-11-23 12:57:46
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	service_description		CPU Usage
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkcpu!-w '80' -c '90'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Drive C: Disk Usage
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkdrivesize!-a 'C': -w '80' -c '95'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Drive D: Disk Usage
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkdrivesize!-a 'D': -w '80' -c '95'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Memory Usage
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkmem!-s physical -w '80' -c '90'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Page File Usage
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkpage!-w '80' -c '90'
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Ping
	use				xiwizard_windowsserver_ping_service
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

define service {
	service_description		Uptime
	use				xiwizard_windowswmi_service
	check_command			check_xi_service_wmiplus!'oya.ad/wmiagent'!'Lisa1984'!checkuptime!-w '7776000' -c '10368000'!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		1440
	notification_period		xi_timeperiod_24x7
	contact_groups			Tier II,Tier III
	_xiwizard			windowswmi
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
Last edited by avandemore on Mon Nov 28, 2016 1:20 pm, edited 1 time in total.
Reason: Please use code tags for output.
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

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

Post by valmberg »

Here is my Nagios XI Installation Profile (attached)
Last edited by dwhitfield on Mon Dec 19, 2016 4:27 pm, edited 1 time in total.
Reason: removing profile for security purposes
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

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

Post by valmberg »

If I go to Config File Management and click "Verify Files", I get the "Things Look Okay" message:

Code: Select all

Nagios Core 4.1.1 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-19-2015 
License: GPL 

Website: https://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
Read object config files okay... 

Running pre-flight check on configuration data... 

Checking objects... 
Checked 170 services. 
Warning: Host 'UAG' has no default contacts or contactgroups defined! 
Checked 100 hosts. 
Checked 8 host groups. 
Checked 9 service groups. 
Checked 10 contacts. 
Checked 5 contact groups. 
Checked 127 commands. 
Checked 16 time periods. 
Checked 0 host escalations. 
Checked 0 service escalations. 
Checking for circular paths... 
Checked 100 hosts 
Checked 0 service dependencies 
Checked 0 host dependencies 
Checked 16 timeperiods 
Checking global event handlers... 
Checking obsessive compulsive processor commands... 
Checking misc settings... 

Total Warnings: 1 
Total Errors: 0 

Things look okay - No serious problems were detected during the pre-flight check
However, if I click "write Configs" then "delete configs" and then "write configs" and "verify files", I get the Error: Service has no hosts and/or service_description message.
Last edited by avandemore on Mon Nov 28, 2016 1:21 pm, edited 1 time in total.
Reason: Please use code tags for output.
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

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

Post by valmberg »

And if I remove the host from the service and put in the '*', it applies the configuration and checks the service on all hosts (*)
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

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

Post by avandemore »

Please repeat my earlier suggestion: https://support.nagios.com/forum/viewto ... 11#p203777

However this time do a Delete Files immediately prior to that.
Previous Nagios employee
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

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

Post by valmberg »

I did exactly as you suggested. Everything came back OK.

Here is the restore and the message after I apply configuration:
Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!


HOWEVER, after the successful "Apply Configuration", I go into a service and make a change on the service (a minor change), it returns the message Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Cenvapprd51.oya.ad.cfg', starting on line 16)" after I apply configuration again.
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 »

Locked