Importing single host cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Importing single host cfg

Post by OptimusB »

I am testing some scripting we will be doing and have created the following host configuration. I ran the prep tool and imported it according to documentation. (I have done these in the past with services and it works just fine...) For some reason, when I import file and apply configuration in XI, the host just does not show up. Am I missing something?

Code: Select all

define host {
	host_name		server
	address			server
	parents			parentdevice
	check_command		check-host-alive!!!!!!!!
	max_check_attempts		2
	check_interval		15
	retry_interval		5
	check_period		xi_timeperiod_24x7
	contact_groups		Contact group
	register		1
	}
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Importing single host cfg

Post by lmiltchev »

Go to the CCM and search for this host there. It is possible that it was added but it's been set as "inactive" because of an issue, i.e. something missing from the directives - parent, contact group, etc. This seems like a pretty simply config - you shouldn't be having any issues.
Be sure to check out our Knowledgebase for helpful articles and solutions!
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Importing single host cfg

Post by OptimusB »

I searched for it but could not find anything. Perhaps I will simply the host cfg further just to make sure that it wasn't a typo or invalid parent/group like you said.
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Importing single host cfg

Post by OptimusB »

I found the issue. The format of the cfg file is UTF-8 which does not work. However if I set it to UTF-8 without BOM, it imports fine.... Not sure if that can be relaxed in future releases.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Importing single host cfg

Post by jdalrymple »

I'm glad you found that out. I copied and pasted from the forum into a terminal and other than having to create the proper parent and hostgroup it imported fine.

So ... would you like us to put a feature request in? I won't lie, that one will be seen as pretty low priority, but I can put it in. Also - good job on troubleshooting it :)

OK to lock and mark solved?
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Importing single host cfg

Post by OptimusB »

If you can that would be great. Cause I am actually generating scripts on a PC and moving the CFG over means I have to convert to correct format before it imports properly. Seems like a good idea to support different encoding of the config.

Thanks and this can be locked.
Locked