Page 1 of 1

Adding hosts via cli.

Posted: Thu Apr 16, 2015 12:57 pm
by epx998
How can I add a host and assign it to a hostgroup via the CLI?

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 1:00 pm
by tmcdonald
You can use the static directory as explained in our documentation:

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

Note that the host will not appear in the CCM when done this way.

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 1:19 pm
by epx998
So in there you have just .cfg files? In each of which, is ll your hosts and what not?

Also doesn't show in the CCM, hmm that is an issue. I thought I could use command.php with some options to inject what I wanted?

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 2:01 pm
by jolson
Why are you trying to add via the CLI instead of the Core Config Manager in the GUI? If you're trying to 'import' some old config files into XI, there's a document for that: http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

The config files should follow the same format as Nagios Core config files: http://nagios.sourceforge.net/docs/3_0/ ... tions.html

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 2:53 pm
by epx998
I am putting together a POC for what we need to do, prior to getting purchase approval, part of that will be adding in 1000+ hosts and being able to manage them via a puppet module. Mostly, I don't want to add 1000+ hosts in a gui and don't want to use an auto discovery plugin that'll do it in a mess.

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 2:57 pm
by jdalrymple
There is a substantial amount of documentation on the Internet about creating Nagios configs with Puppet. You then just dump the config into the import directory and call the Nagios reconfigure script.

Check this out:

https://groups.google.com/forum/#!msg/p ... lLForAhKwJ

Re: Adding hosts via cli.

Posted: Thu Apr 16, 2015 3:00 pm
by jolson
In addition to jdalrymples doc, please note that we have an official doc for this as well: http://assets.nagios.com/downloads/nagi ... gement.pdf