Hello,
Is there an easy way to export all hosts adn their ip address to Excel or csv so it can be used (after adding a coma) for the cloning wizard?
Export hosts and ip's
Export hosts and ip's
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Export hosts and ip's
I'm a little confused, the cloning wizard is for adding NEW hosts, where do you want to export the addresses and IP's from?
I'm assuming you don't want to export them from Nagios XI as they are already in the system. Please correct me if I am wrong.
I'm assuming you don't want to export them from Nagios XI as they are already in the system. Please correct me if I am wrong.
Re: Export hosts and ip's
Well, as we are in a rapidly growing environment, there is every week some new service we want to add to our existing servers. I noticed that when you use the cloning wizard this seems to work when you only select the new service you want to add and then select your existing host, Nagios adds the new service to the existing hosts. Is there a faster way to add a new service to all or a subpart of all hosts?
As using my method requires me to have an up to date list of all hosts and their ip, this would be very useful to export somehow..
As using my method requires me to have an up to date list of all hosts and their ip, this would be very useful to export somehow..
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Export hosts and ip's
WillemDH,
Have you looked at an architecture like NRDS? NRDS allows you to define services and checks in a centrally stored config, which then gets scoped up by all hosts. This makes it easy to add a single service to a config and then all hosts would use that new service definition.
http://assets.nagios.com/downloads/nagi ... h_NRDS.pdf
-Yancy
Have you looked at an architecture like NRDS? NRDS allows you to define services and checks in a centrally stored config, which then gets scoped up by all hosts. This makes it easy to add a single service to a config and then all hosts would use that new service definition.
http://assets.nagios.com/downloads/nagi ... h_NRDS.pdf
-Yancy
Re: Export hosts and ip's
No, I didn't look at NRDS yet. I'll look into it tomorrow. Thanks for letting me know. I've been using the clone wizard untill now add services to hosts. I'll let you know of I get the NRDS working.
Just a questions, is it ok for me to use the bulk cloning wizard or is there any reason I should not use to add services to existing hosts.
Just a questions, is it ok for me to use the bulk cloning wizard or is there any reason I should not use to add services to existing hosts.
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Export hosts and ip's
Ok, I just had a look at http://library.nagios.com/library/produ ... s-tutorial
and I'm not sure how I should start using this.
Our environment is 99 % Windows and we got several very specific checks running both local and remote with nrpe and nsca. I really like the latest version of the NSCP agent.
Are you sure I should use NRDS? We have so many servers all with different needs etc. it seems like a lot of work.. The bulk host cloning wizard is next next finish and all servers I paste into the textbox get their new service..
As I asked in my previous psot, is there any reason not to do it like I've explained above?
and I'm not sure how I should start using this.
Our environment is 99 % Windows and we got several very specific checks running both local and remote with nrpe and nsca. I really like the latest version of the NSCP agent.
Are you sure I should use NRDS? We have so many servers all with different needs etc. it seems like a lot of work.. The bulk host cloning wizard is next next finish and all servers I paste into the textbox get their new service..
As I asked in my previous psot, is there any reason not to do it like I've explained above?
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Export hosts and ip's
You should also be able to add using the bulk host import
1) add new service to an existing host
2) add all IP addresses of existing hosts to the bulk host import wizard and use template host from step 1
This should add the templated services to all the hosts without overwriting existing services I believe. I would however test with using the bulk host wizard with a single host first.
-Yancy
1) add new service to an existing host
2) add all IP addresses of existing hosts to the bulk host import wizard and use template host from step 1
This should add the templated services to all the hosts without overwriting existing services I believe. I would however test with using the bulk host wizard with a single host first.
-Yancy
Re: Export hosts and ip's
Yancy,
I have been testing this over the last week and can confirm the described method is working fine to add services to existing hosts.
Coming back to my original question, can you understand when using my method it would be very handy to be able to export for example all host and ip's of a hostgroup? is there already a feature to export hosts and their ip to a csv? Should I make a feature request for this?
Grtz
I have been testing this over the last week and can confirm the described method is working fine to add services to existing hosts.
Coming back to my original question, can you understand when using my method it would be very handy to be able to export for example all host and ip's of a hostgroup? is there already a feature to export hosts and their ip to a csv? Should I make a feature request for this?
Grtz
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Export hosts and ip's
You can get this info in XML format from the Admin -> Manage Components -> Backend API URL
Re: Export hosts and ip's
Scot! This was exactly what I was looking for! Really! Imported the xml into Excel and this is some wonderful information to play with.. 
It also answers some other question I had about exporting hostgroup members etc!
It also opens the door for some new questions (
) => Is it somehow possible to edit this xml file directly? Or edit it and then import it to Nagios?
I'm asking this as it would be superb if we could compare this with our server database and add hosts to hostgroup based on our internal server database. Making something like this happen would result in an always up to date hostgroup configuration.. As now when a server moves to another datacenter, we have to update the internal server database and then change the hostgroup in Nagios too..
It also answers some other question I had about exporting hostgroup members etc!
It also opens the door for some new questions (
I'm asking this as it would be superb if we could compare this with our server database and add hosts to hostgroup based on our internal server database. Making something like this happen would result in an always up to date hostgroup configuration.. As now when a server moves to another datacenter, we have to update the internal server database and then change the hostgroup in Nagios too..
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net