NagiosXI GraphQL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
apteancloud
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

NagiosXI GraphQL

Post by apteancloud »

Hi,

We have an API which is querying to MongoDB with GraphQL. We want to capture the output of the GraphQL query to NagiosXI and publish it on report. Is this feature available?
If not, is there any workaround to fetch the data from NagioSQL DB?

I am passing like this:

Code: Select all

./check_http -H MYURL -u '/PATH?query=query%20getProjects%28%24orderDirection%3AOrderingOptions%2C%24filters%3A%5BFilters%5D%29%7Bprojects%28orderDirection%3A%24orderDirection%2Cfilters%3A%24filters%29%7BprojectId%7D%7D'
The output is:

Code: Select all

HTTP OK: HTTP/1.1 200 OK - 263 bytes in 0.036 second response time |time=0.035916s;;;0.000000 size=263B;;;0
The desired output is:

Code: Select all

{
  "data": {
    "projects": [
      {
        "projectId": "84z9zk"
      }
    ]
  }
}
Regards,
Amitabh
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NagiosXI GraphQL

Post by ssax »

Please be more specific on what you mean by this:
publish it on report
You could add a -v to the check_http plugin to see the output but the multi-line output is only displayed on the service detail page. If that doesn't meet your needs you'd likely need to find an alternative plugin that outputs it all on one line but that would break your formatting anyways, the text would still be there but it would be on a single line.
apteancloud
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: NagiosXI GraphQL

Post by apteancloud »

Is there any inbuilt plugin in Nagios that gives me an output, rather than OK/Not OK type?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NagiosXI GraphQL

Post by benjaminsmith »

Hi,

I did a lookup on the Nagios Exchange, and I'm not aware of a plugin for directly monitoring data from a graphql query.

All plugins must return an exit code the indicate the state of the host or service. The status message is optional. I could submit a feature request for you or another option is to make one, take a look a the guidelines below.

https://nagios-plugins.org/doc/guidelines.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
apteancloud
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: NagiosXI GraphQL

Post by apteancloud »

Please archive this thread. This is no longer a requirement.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NagiosXI GraphQL

Post by benjaminsmith »

Hi,
Please archive this thread. This is no longer a requirement
Sounds good. Thanks for the update.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked