Page 1 of 1
Nagios API for third party integration
Posted: Tue Aug 01, 2017 3:13 am
by dipit2007
Is there any in-build API inside Nagios Core to get status data and configuration data for integration with third party application like Django?
Re: Nagios API for third party integration
Posted: Tue Aug 01, 2017 8:22 am
by mcapra
In terms of pulling data, you can use the JSON CGIs (you can skip to the "To get started using the CGIs" section):
https://labs.nagios.com/2014/06/19/expl ... -7-part-1/
In terms of pushing data, that's a bit trickier. You can leverage the external commands file to programatically take just about any action in Nagios Core, but you'd need write access for that file on the machine itself which can be a pain when integrating with web frameworks. To get around that, you can leverage something like NRDP to submit those external commands:
https://github.com/NagiosEnterprises/nrdp
https://old.nagios.org/developerinfo/ex ... ndlist.php
If you have a specific use case you wanted more information about, I'm sure myself and others could provide answers.
Though it's not free,
Nagios XI includes a fairly robust REST API.
https://support.nagios.com/kb/article/n ... d-api.html
Re: Nagios API for third party integration
Posted: Tue Aug 01, 2017 9:01 am
by eloyd
Nagios XI can actually be free, depending on how many hosts you're monitoring (<7). So you may be able to use that, depending on your requirements.
Re: Nagios API for third party integration
Posted: Tue Aug 01, 2017 3:33 pm
by cdienger
Did the responses from eloyd and mcapra answer your questions?
Re: Nagios API for third party integration
Posted: Wed Aug 02, 2017 1:42 am
by dipit2007
Yes Thanks a lot.
Is there any complete documentation for API developer. i.e. response data details and how to call all API.
Re: Nagios API for third party integration
Posted: Wed Aug 02, 2017 7:26 am
by eloyd
Re: Nagios API for third party integration
Posted: Wed Aug 02, 2017 8:00 am
by danjoh
Let me chime in here...
This "JSON-feature" looks great! I have on question though: Where can I find a description of all the result "fields"?
E.g.
Code: Select all
"servicegroup": {
"name": "XYZ",
"services": [
{
"host_name": "ABC",
"description": "DEF",
"time_ok": 0,
"time_warning": 0,
"time_critical": 0,
"time_unknown": 0,
"scheduled_time_ok": 0,
"scheduled_time_warning": 0,
"scheduled_time_critical": 0,
"scheduled_time_unknown": 0,
"time_indeterminate_nodata": 0,
"time_indeterminate_notrunning": 0
},
"host_name", "description", "time_ok", "time_warning", "time_critical" and "time_unknown" seems quite straightforward - but the other six?
As I said, are there and documentation available which explains this?
Re: Nagios API for third party integration
Posted: Wed Aug 02, 2017 4:45 pm
by dwhitfield
danjoh wrote:
As I said, are there and documentation available which explains this?
It looks like nothing other than the URLs already given. Of course, it's all hanging out at
https://github.com/NagiosEnterprises/nagioscore/ too.