no hosts and/or service_description After Bulk Modify

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

no hosts and/or service_description After Bulk Modify

Post by meatzie »

Hello,

I used the bulk modification tool to copy a few services to many hosts via a hostgroup. When I try to apply the changes, I get an error stating that
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/server_name.cfg', starting on line 87)
It looks like configs have been made for each host that I wanted, but there is no host in the config. Here is that service's config from the error.

Code: Select all

define service {
	service_description		Used Memory Percent
	display_name			Memory Consumed Percent
	check_command			check_xi_ncpa!-t 'password' -M 'memory/virtual/percent' -w 70 -c 90 -u Gi!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			2
	active_checks_enabled		1
	check_period			24x7
	process_perf_data		1
	notification_interval		180
	notification_period		24x7
	notifications_enabled		0
	register			1
	}	
It would seem to me that adding a service to a host would add the host to the service, is this intentional or a bug? If this is intended behavior, how would I be able to copy a service to many hosts at once?
kyang

Re: no hosts and/or service_description After Bulk Modify

Post by kyang »

@meatzie,

I think instead of doing it towards a host group, --> Select a service --> Select hosts that you want to add a service into.

For example, if you add a service called "ping test" and select then "Manage Hosts" --> select 2 or more hosts you want to add the service to.

Save the changes and then apply the configuration. Then it should work as if you wanted to add to a hostgroup, but just select the hosts instead.

Let me know how it goes.
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

Re: no hosts and/or service_description After Bulk Modify

Post by meatzie »

OK, I reverted and selected a few services and a few hosts. Got the same result, same error message.
kyang

Re: no hosts and/or service_description After Bulk Modify

Post by kyang »

Okay, which version of Nagios XI are you on?

Or more importantly, which version of the "Bulk Modifications Tool" do you have? Located in (XI homepage --> Admin -> under System Extensions click Manage Components --> Scroll down until you see Bulk Modifications Tool)

If it's not on version 2.1.5, you can update it at the top. "Check for Updates" Then install it, and try again.

I haven't been able to replicate this issue, so I wanted to make sure you're on the latest version.

Let us know what you have, thanks!
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

Re: no hosts and/or service_description After Bulk Modify

Post by meatzie »

I am currently on Nagios 5.4.11 and Bulk Modifications tool is up to date at 2.1.5.
kyang

Re: no hosts and/or service_description After Bulk Modify

Post by kyang »

Thanks for letting me know.
Let's take a step back and try verifying some of your configs --> go to Configure --> core config manager --> under tools --> click Config File management.
Then click --> write Configs --> delete --> write --> verify and show us the output of that.

Also, could you try doing 1 service to 1 host?

If the result works, try doing 1 service to 2 hosts.

Let me know your findings.

Mine seems to work and creates many services for multiple hosts when I do it.
test.PNG
You do not have the required permissions to view the files attached to this post.
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

Re: no hosts and/or service_description After Bulk Modify

Post by meatzie »

OK, with no pending changes this is the output of the verification.

Code: Select all

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'Vlan1 Status' on host 'USS-SWT-10' (config file '/usr/local/nagios/etc/services/10.20.254.11.cfg', starting on line 111)
Warning: Duplicate definition found for service 'Vlan1 Bandwidth' on host 'USS-SWT-10' (config file '/usr/local/nagios/etc/services/10.20.254.11.cfg', starting on line 95)
Warning: Duplicate definition found for service 'StackPort2 Status' on host 'USS-SWT-10' (config file '/usr/local/nagios/etc/services/10.20.254.11.cfg', starting on line 79)
Warning: Duplicate definition found for service 'StackPort2 Bandwidth' on host 'USS-SWT-10' (config file '/usr/local/nagios/etc/services/10.20.254.11.cfg', starting on line 63)
Warning: Duplicate definition found for service 'Ping' on host 'USS-SWT-10' (config file '/usr/local/nagios/etc/services/10.20.254.11.cfg', starting on line 48)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1933 services.
Checked 243 hosts.
Checked 31 host groups.
Checked 0 service groups.
Checked 9 contacts.
Checked 3 contact groups.
Checked 138 commands.
Checked 16 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 243 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: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
When using the bulk modifications tool to add the service to only one host I got:
Configuration verification failed.

An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

I'm not sure if it makes a difference, but the service I'm trying to add currently does not have a host assigned to it, only a hostgroup. I'm trying to get from a few services with hostgroups assigned to every server having the service tied to one template so that it's easier to make exceptions with services as I need to.
With the more info showing the same error as before:
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/uhqserver-10.cfg', starting on line 16)
kyang

Re: no hosts and/or service_description After Bulk Modify

Post by kyang »

I'm not sure if it makes a difference, but the service I'm trying to add currently does not have a host assigned to it, only a hostgroup. I'm trying to get from a few services with hostgroups assigned to every server having the service tied to one template so that it's easier to make exceptions with services as I need to.
With the more info showing the same error as before:
Thanks for letting us know. I tried adding a service that had only a host group and no host's attached. I indeed did get the same error of Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/localhost.cfg', starting on line 76)

Does adding a service that has a host not do what you would want?

I was able to add a service that has a host, and added it to a host group just fine so maybe that would work for you.
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

Re: no hosts and/or service_description After Bulk Modify

Post by meatzie »

So I was able to get this done by adding a host to each of the services and then performing the same operation I had before with the bulk modification tool. It worked fine this way, but I feel like this is an unnecessary and vague workaround for something that should otherwise work just fine. I can certainly see myself running into situations like this again in the future.

Thanks for all your help and I hope this will get resolved in future versions of the bulk modification tool.
meatzie
Posts: 10
Joined: Tue Nov 29, 2016 6:46 am

Re: no hosts and/or service_description After Bulk Modify

Post by meatzie »

Also, it seems that service templates are lost when using the bulk modification tool to add services to hosts as well. While the modification tool mentions that,
** Parent, contact, and group relationships will not be copied **
It should probably also mention that templates will not be copied either.

Edit: My bad, it says this right on the main menu of the tool.
Locked