z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

NagiosXI GraphQL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.

NagiosXI GraphQL

Postby apteancloud » Thu Apr 22, 2021 5:14 am

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
apteancloud
 
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: NagiosXI GraphQL

Postby ssax » Thu Apr 22, 2021 5:26 pm

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.
ssax
Dreams In Code
 
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NagiosXI GraphQL

Postby apteancloud » Tue Apr 27, 2021 4:57 am

Is there any inbuilt plugin in Nagios that gives me an output, rather than OK/Not OK type?
apteancloud
 
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: NagiosXI GraphQL

Postby benjaminsmith » Tue Apr 27, 2021 1:54 pm

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!
benjaminsmith
 
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NagiosXI GraphQL

Postby apteancloud » Tue May 18, 2021 11:18 pm

Please archive this thread. This is no longer a requirement.
apteancloud
 
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: NagiosXI GraphQL

Postby benjaminsmith » Wed May 19, 2021 9:17 am

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!
benjaminsmith
 
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul


Return to Nagios XI

Who is online

Users browsing this forum: Google [Bot] and 25 guests