Hello,
I am trying to pull out free variables for enrichment of a Grafana dashboard. From grafana, i am querying the statusjson.cgi on a servicegroup to pull monitor status. My goal is to use another query to pull back free variables and join the results on servicename.
I see that when i target the objectjson.cgi on a specific host and service, the free variables are returned. However, when i try to query the objectjson.cgi for "servicelist" or "servicegrouplist" I get a 504 error. Is there anything I can do to fix this? Is there another way to pull back the free variables on a given service?
Thank you!
Resolved | JSON Query Generator
-
gwesterman
- Posts: 269
- Joined: Wed Aug 23, 2023 11:29 am
Re: JSON Query Generator
Hi @wneville,
Try going to http://<your nagios server>/nagios/jsonquery.html and generating your query there. Let us know if that query works or if it also 504s.
You should also be able to use the API (the docs are found in XI in the Help section) for what you are looking for.
If you have any additional questions, please reach out.
Thank you!
Try going to http://<your nagios server>/nagios/jsonquery.html and generating your query there. Let us know if that query works or if it also 504s.
You should also be able to use the API (the docs are found in XI in the Help section) for what you are looking for.
If you have any additional questions, please reach out.
Thank you!
Re: JSON Query Generator
Thanks for your response! I started on the jsonquery.html page but nothing happened when i pressed 'send query' which prompted me to go somewhere where i could see if the query was being sent/what error would be given.
If possible, I would like to run these from the same Grafana data source (nagios json cgi). Is it possible to get the free variables for all the services in a servicegroup (using any of the objectjson queries)? Then I can create a join/union on the servicename to match up the two queries.
In other places I have used wildcards, but I can't seem to drill down to custom variables using wildcards on the 'service' query in objectjson.cgi
If I can resolve the 504 errors I can investigate what all is available, any ideas on how I can resolve that?
If possible, I would like to run these from the same Grafana data source (nagios json cgi). Is it possible to get the free variables for all the services in a servicegroup (using any of the objectjson queries)? Then I can create a join/union on the servicename to match up the two queries.
In other places I have used wildcards, but I can't seem to drill down to custom variables using wildcards on the 'service' query in objectjson.cgi
If I can resolve the 504 errors I can investigate what all is available, any ideas on how I can resolve that?
-
gwesterman
- Posts: 269
- Joined: Wed Aug 23, 2023 11:29 am
Re: JSON Query Generator
Hi @wneville,
This thread may be useful. Another user was getting a timeout accessing the archivejson.cgi. Try some of the steps outlined in the thread, namely verifying file permissions, checking for selinux, and potentially increasing the apache timeout.
Let us know what you find.
Thank you!
This thread may be useful. Another user was getting a timeout accessing the archivejson.cgi. Try some of the steps outlined in the thread, namely verifying file permissions, checking for selinux, and potentially increasing the apache timeout.
Let us know what you find.
Thank you!
Re: JSON Query Generator
Thanks for passing that along, with that I was able to resolve the issue!
When I pressed "send query" in the json query generator, a message appeared in /var/log/httpd/ssl_error_log:
I increased my Timeout in httpd.conf from 10 to 30 and now the query can complete successfully. Thanks so much!
When I pressed "send query" in the json query generator, a message appeared in /var/log/httpd/ssl_error_log:
Code: Select all
[Tue Oct 15 10:43:27.107868 2024] [cgid:warn] [pid 3325225:tid 139846584612608] [client [IP]] AH01220: Timeout waiting for output from CGI script /usr/local/nagios/sbin/objectjson.cgi, referer: https://nagiossrv1/nagios/jsonquery.html
[Tue Oct 15 10:43:27.107922 2024] [cgid:error] [pid 3325225:tid 139846584612608] [client [IP]] Script timed out before returning headers: objectjson.cgi, referer: https://nagiossrv1/nagios/jsonquery.html-
gwesterman
- Posts: 269
- Joined: Wed Aug 23, 2023 11:29 am
Re: Resolved | JSON Query Generator
I'm glad I could help!
I'm going to lock this thread to keep the forum organized.
Please reach out if you encounter any other issues!
I'm going to lock this thread to keep the forum organized.
Please reach out if you encounter any other issues!