Nagios API for third party integration

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dipit2007
Posts: 6
Joined: Sun Dec 22, 2013 5:19 am

Nagios API for third party integration

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios API for third party integration

Post 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
Former Nagios employee
https://www.mcapra.com/
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Nagios API for third party integration

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios API for third party integration

Post by cdienger »

Did the responses from eloyd and mcapra answer your questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dipit2007
Posts: 6
Joined: Sun Dec 22, 2013 5:19 am

Re: Nagios API for third party integration

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Nagios API for third party integration

Post by eloyd »

Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
danjoh
Posts: 73
Joined: Mon Dec 07, 2015 10:43 am
Location: Zürich, Switzerland
Contact:

Re: Nagios API for third party integration

Post 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?
--
D/\N
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios API for third party integration

Post 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.
Locked