automate the process of adding and removing hosts and servic

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagedre
Posts: 29
Joined: Thu Sep 26, 2019 11:45 am

automate the process of adding and removing hosts and servic

Post by nagedre »

Hi Team,
Could some one explain with details (commands) how to configure/Remove servers through putty (command line) in Nagios

Regards,
Nagarjuna
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: automate the process of adding and removing hosts and se

Post by jbrunkow »

PuTTY is just a client commonly used to establish SSH connections from Windows machines. Are you looking to prohibit certain people from having SSH access to certain servers, or remove a server from being monitored by Nagios? Please provide more of a description, so that I can provide the correct instructions. I'm not sure what your goal is.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nagedre
Posts: 29
Joined: Thu Sep 26, 2019 11:45 am

Re: automate the process of adding and removing hosts and se

Post by nagedre »

Hi jbrunkow,
My Goal here is to configure/Remove hosts from command line not from Nagios GUI.
I need the steps how to configure/remove hosts.
Also what are the commands needed for bulk hosts adding to monitoring.example like : I want to add 50 servers to monitoring at a time that I want to do with commands for bulk hosts adding

Please let me know stil any information needed here,.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: automate the process of adding and removing hosts and se

Post by lmiltchev »

The way I see it, you have a couple of options.

1. You could add new hosts and services via the REST API in Nagios XI. You can view the API documentation from Nagios XI web UI under the Help menu. There are some example there for adding hosts/services from the command line (see the "Config Reference" section).

Note: You could use individual commands or you could place your API calls into a bash script, and run them this way (in bulk).

2. You could also create configs via some kind of scripting solution, place them in the /usr/local/nagios/etc/import directory, and run the following command to apply the configs to XI:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Tip: You need to make sure that your configs are correct, prior to running the command above. Configuring Nagios XI from the command line is an option for advanced users and it's assumed that you know what you are doing.

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked