Page 1 of 1

automate the process of adding and removing hosts and servic

Posted: Thu Jun 18, 2020 9:56 am
by nagedre
Hi Team,
Could some one explain with details (commands) how to configure/Remove servers through putty (command line) in Nagios

Regards,
Nagarjuna

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

Posted: Thu Jun 18, 2020 2:08 pm
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.

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

Posted: Fri Jun 19, 2020 12:58 am
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,.

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

Posted: Fri Jun 19, 2020 2:47 pm
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.