We are currently using nagios core and evaluating Nagios XI. Right now when we setup an application server we have a job that automatically adds the application server monitor and disables it until the developer deploys their code. The monitor is created using a sed script which just outputs the definition to the host file. (Our host and services are all stored within a single file). When the developer deploys their code the startup script for tomcat sends a command to nagios.cmd which then turns on the alerts for that service.
From what I read in XI the configs are stored in a database which then writes out the config file. Is this correct? If that is the case what happens if we update the config file with our scripts?
I read about the XI api, but it looks like that is read only. Is there a better way to automate the setup of a host and/or service check?
Monitor Setup Automation
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Monitor Setup Automation
You have a couple of options. It is entirely possible to just store your configs in the static directory within nagios/etc. These files are never overwritten from the XI interface. Alternatively, you could put them into the import directory of nagios/etc and apply configuration to import them. Finally, you can definitely interface with nagios via the API or the pages directly with curl post requests and appending the backend api key to the page. You can use this logic to access and modify any page within XI and still have management via the XI interface. As a side note, we will be having a talk at the world conference, in a few weeks, that discusses issues exactly like this and how to use the nagios APIs.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.