Page 1 of 1

NagiosXI GraphQL

Posted: Thu Apr 22, 2021 5:14 am
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

Re: NagiosXI GraphQL

Posted: Thu Apr 22, 2021 5:26 pm
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.

Re: NagiosXI GraphQL

Posted: Tue Apr 27, 2021 4:57 am
by apteancloud
Is there any inbuilt plugin in Nagios that gives me an output, rather than OK/Not OK type?

Re: NagiosXI GraphQL

Posted: Tue Apr 27, 2021 1:54 pm
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

Re: NagiosXI GraphQL

Posted: Tue May 18, 2021 11:18 pm
by apteancloud
Please archive this thread. This is no longer a requirement.

Re: NagiosXI GraphQL

Posted: Wed May 19, 2021 9:17 am
by benjaminsmith
Hi,
Please archive this thread. This is no longer a requirement
Sounds good. Thanks for the update.