Hello,
every time our Nagios REST API is called, we receive this error at the beginning of the response:
<p><pre>SQL Error [nagiosxi] : ERROR: syntax error at or near "objects"
LINE 1: ...6-23 13:07:12','API','jenkins',16,'API endpoint \'objects/ho...
^</pre></p>
Nevertheless the call is successful, but some tools get confused with this first lines.
Do you know where this is comming from?
Nagios: 5.7.1
We also tried repairing the database with your script, but the error is still coming up.
Thank you.
BR,
Alex
Error calling the REST API
Re: Error calling the REST API
Can you show us the actual command (API call) that you are using, in addition to the output?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Error calling the REST API
I am getting this error with each call to the API and also calling the API with a browser and also with CURL
e.g. call
nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXX8&pretty=1&hostgroup=XXXXX
e.g. call
nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXX8&pretty=1&hostgroup=XXXXX
Re: Error calling the REST API
I haven't been able to replicate the issue in house - the same API call works for me in 5.7.1. Can you PM me your profile? We will review it to see if we are going to find any clues/errors. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Error calling the REST API
We had the same issue after upgrading to XI 5.7.1
The issue turned out to be related to the following problem:
https://support.nagios.com/kb/article/n ... r-754.html
The resolution suggested in the article solved the error from being displayed with the JSON output from the API
The issue turned out to be related to the following problem:
https://support.nagios.com/kb/article/n ... r-754.html
The resolution suggested in the article solved the error from being displayed with the JSON output from the API
Re: Error calling the REST API
Thanks for the feedback @umunix!
@alex9000, let us know if the KB article listed in the previous post solves your issue. Thanks!
@alex9000, let us know if the KB article listed in the previous post solves your issue. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!