This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
ciaranrh
Posts: 37 Joined: Thu Jul 09, 2015 3:54 pm
Post
by ciaranrh » Thu Jun 02, 2016 2:33 pm
Hello,
I'm having an issue accessing the Rest API 'GET objects/servicestatus'. When I try the following command:
Code: Select all
curl -XGET "http://*********/nagiosxi/api/v1/objects/servicestatus?apikey=ahussqm24eq5khp5v8fmivbege75g7onnmjhh9jikbn7re9qmnf8lnj35o7isu9j&pretty=1 > nagios_servicestatusthere is an expected delay and then no output to my file. Curiously when getting data from the Rest API for other sources like objects/hoststatus I get the expected JSON output, it just seems that servicestatus is the only one I can't get output from.
My only guess as to why this would be is the fact that the Nagios server I'm getting this data from has close to 10000 service checks so I might be running into some kind of limitation of the API. Hopefully that's not the case though. Anyone out there run into something similar?
Mod Edit: Please wrap long outputs/inputs in
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Thu Jun 02, 2016 3:07 pm
You forgot a " at the end, which causes the curl not to post. Try this -
Code: Select all
curl -XGET "http://*********/nagiosxi/api/v1/objects/servicestatus?apikey=ahussqm24eq5khp5v8fmivbege75g7onnmjhh9jikbn7re9qmnf8lnj35o7isu9j&pretty=1" > nagios_servicestatus
Former Nagios Employee
ciaranrh
Posts: 37 Joined: Thu Jul 09, 2015 3:54 pm
Post
by ciaranrh » Thu Jun 02, 2016 4:45 pm
Thanks,
That was just poor formatting when copying and pasting on my part (my bad), the command I'm running on the server does in fact have the ending " like so:
Code: Select all
curl -XGET "http://*********/nagiosxi/api/v1/objects/servicestatus?apikey=ahussqm24eq5khp5v8fmivbege75g7onnmjhh9jikbn7re9qmnf8lnj35o7isu9j&pretty=1" > nagios_servicestatus
lmiltchev
Bugs find me
Posts: 13589 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Thu Jun 02, 2016 5:00 pm
Have you tried tweaking the resource limits in the "/etc/php.ini" file (i.e. max_execution_time, memory_limit) ?
Be sure to check out our
Knowledgebase for helpful articles and solutions!
ciaranrh
Posts: 37 Joined: Thu Jul 09, 2015 3:54 pm
Post
by ciaranrh » Fri Jun 03, 2016 3:25 pm
Thanks for the tip, that got it squared away.
The only change I made was to memory_limit in /etc/php.ini.
The original setting was:
memory_limit = 128M
I tried setting that to 256M and it still wasn't working but bumping that up a little more to 512M did the trick.
Thanks again!
tmcdonald
Posts: 9117 Joined: Mon Sep 23, 2013 8:40 am
Post
by tmcdonald » Mon Jun 06, 2016 10:29 am
Glad to hear it! Are we alright to close this thread?
Former Nagios employee
ciaranrh
Posts: 37 Joined: Thu Jul 09, 2015 3:54 pm
Post
by ciaranrh » Mon Jun 06, 2016 10:50 am
Yes, please do. Hopefully this will help someone else out there too
Thanks,
Ciaran