Page 1 of 1
Nagios XI - Automation using Ansible
Posted: Mon Jun 01, 2020 8:51 am
by veeravamsi
Hi Team,
We are exploring options to Auto-Deploy Nagios Monitoring using Ansible , and i also read some article on nagios website about tight integration with these two Tools . So is there any Ansible YAML Playbooks that are already built or used by any of your customers to deploy monitoring ?
1. If we use Nagios APIs to deploy monitoring ? If so , I didnt find any API for Templates ?
2. Should we go with writing Scripts to invoke to do this task ?
Thank you in advance.
--Vamsi
Re: Nagios XI - Automation using Ansible
Posted: Mon Jun 01, 2020 3:35 pm
by jbrunkow
The ones listed in the videos are located in:
/usr/local/nagiosxi/scripts/automation/ansible/ncpa_autoregister
Although we do not currently support
Ansible integration, we are happy to announce that we will be adding it in the next release of version
5.7 this summer! The relevant playbooks will likely also be disclosed at that time.
I do not believe the API contains a method for deploying agents.
I hope that helps!

Re: Nagios XI - Automation using Ansible
Posted: Tue Jun 02, 2020 2:23 am
by veeravamsi
This is awesome

. I will go through the scripts/modules on that path.
Do you know if this will Deploy Monitoring ( CPU , Mem , Disk , etc as defined in Templates ) ? Meaning we can invoke relevant APIs from other Tools/Integrations to Deploy Monitoring for given Server ( or Set of Servers ).
Re: Nagios XI - Automation using Ansible
Posted: Tue Jun 02, 2020 2:16 pm
by jbrunkow
From what I've seen, the NCPA deployment with Ansible looks kind of like a Wizard. Like a Wizard, I believe it deploys a default set of checks. Like almost all Nagios products, I'm sure that feature will be configurable as well! I believe an agent deployed from it should also be able to communicate with the API.
Re: Nagios XI - Automation using Ansible
Posted: Thu Jun 04, 2020 7:48 am
by veeravamsi
Thanks alot. One last question - Does Nagios has any API to Enable/Disable a Monitor( Service or Host checks ) ?
Re: Nagios XI - Automation using Ansible
Posted: Thu Jun 04, 2020 1:27 pm
by jbrunkow
Nagios XI does indeed offer a
REST API. The documentation for which is located in the
Help section of your
XI instance > under
API Docs and
Developer Docs on the left pane.
Code: Select all
http://< IP address >/nagiosxi/help/api.php
I don't see a way to turn monitoring off for a given host that way. You can schedule
Downtime by navigating to
Schedule Downtime under
Incident Management on the left pane of the home page.
What is the scenario where you would want to disable monitoring? Maybe I can be more helpful if I understand the context better.
Re: Nagios XI - Automation using Ansible
Posted: Tue Jun 09, 2020 9:09 am
by veeravamsi
Sure np. We are trying to automate things ( or let Users do simple things ) like Enable / Disable Monitor remotely using API or command when Service(s) is Down and dont want to receive too many Alerts/Notifications.
Re: Nagios XI - Automation using Ansible
Posted: Tue Jun 09, 2020 2:21 pm
by jbrunkow
That sounds like a use case for downtime or acknowledging alerts, depending on whether the event is planned or not.
Alternatively, you could acknowledge a problem by clicking on Host (or) Service Status > then on the title of the object producing unwanted notifications > and clicking Acknowledge this problem on the Host (or) Service Status Detail page.