Page 1 of 1
Backend Write Access (XI)
Posted: Tue Aug 09, 2011 8:00 am
by dhruvaps
Hello,
We are evaluating Nagios XI, and need to be able to automate the addition of new hosts (this will be triggered by a web service).
Unlike Nagios Core, it is not clear how to do this in XI. I found the plugin for
backend access, but this appears to be read-only.
The approaches that occur to me are:
- Write a plugin which accomplishes this (is this possible with the API?)
- Insert the data directly into the database (this seems quite complicated)
- Create Nagios Core text configuration files
Any insights would be greatly appreciated.
Re: Backend Write Access (XI)
Posted: Tue Aug 09, 2011 11:10 am
by mguthrie
A much simpler way would be this:
Use your automation to create a new text config file
Copy those configs to the /usr/local/nagios/etc/import directory
Run: /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
At the moment we don't have a way to do this through the web api.
Re: Backend Write Access (XI)
Posted: Wed Aug 10, 2011 1:02 pm
by dhruvaps
Thanks for your reply, mguthrie. That seems to work, but I noticed that reconfigure_nagios.sh actually restarts the server. As this solution will potentially be monitoring thousands of servers, we would prefer to update the configuration without taking down Nagios. Is there a way to update the configuration on the fly (whether by updating a database, or sending a SIGHUP signal)?
Re: Backend Write Access (XI)
Posted: Wed Aug 10, 2011 4:25 pm
by mguthrie
You can't apply any configuration changes in Nagios without restarting application. This is the normal process to make a change to the monitoring configuration.
(I'm going to move this thread to the Nagios XI General Forum, it will get more viewing traffic).
Re: Backend Write Access (XI)
Posted: Wed Aug 24, 2011 2:22 pm
by gabriel.giordano
Hello,
I need something like the question dhruvaps posted. I use Nagios to monitor the network, but i need to take some action when the network has a fault.
For example: The Nagios sends data to the database when the network status changes. Or The nagios activates another system with wsdl.
Is this possible?'
Thanks
Re: Backend Write Access (XI)
Posted: Mon Sep 05, 2011 5:25 am
by No60MdiS
mguthrie wrote:A much simpler way would be this:
Use your automation to create a new text config file
Copy those configs to the /usr/local/nagios/etc/import directory
Run: /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
At the moment we don't have a way to do this through the web api.
thanks for this..
Re: Backend Write Access (XI)
Posted: Tue Sep 06, 2011 1:02 pm
by nscott
gabriel,
Thats an area of active development but there are some things that might help you. A good place to start is this document;
http://assets.nagios.com/downloads/nagi ... ndlers.pdf
It explains event handlers and how to use them, which sound exactly like what you're looking for.