API page has HTTP ERROR 500

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

API page has HTTP ERROR 500

Post by optionstechnology »

You guys fixed this for me before but I cant find/remember the ticket

getting a HTTP ERROR 500 when trying to open the /objects/services API page

The others are fine

I think it was a timeout setting somewhere or something like that?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: API page has HTTP ERROR 500

Post by tgriep »

I would guess that the setting was changed could of been a a PHP settings or an Apache settings
Lets see if you can capture any errors.

Run this in a root shell.

tail -f /var/log/httpd/*_log

Then run your API call and post all of the output from the tail command so we can check it for errors.
Be sure to check out our Knowledgebase for helpful articles and solutions!
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: API page has HTTP ERROR 500

Post by optionstechnology »

The logs are vast for this - I did a tail -n 10 instead if that helps?

PM ed the results to you
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: API page has HTTP ERROR 500

Post by tgriep »

Sorry, the data did not provide any information in the issue for the API.

I am going to have to see all of the data or you can search through the files for the 500 error and see if you can figure it out.

Zip it up if it is too big.
Be sure to check out our Knowledgebase for helpful articles and solutions!
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: API page has HTTP ERROR 500

Post by optionstechnology »

Sorry - I've sent the full ones gathered since yesterday - I clicked a URL a good few times so there should be something in there

Thanks
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: API page has HTTP ERROR 500

Post by tgriep »

I see the 500 error on the log files now but they do not have any details on what is causing the error.
How many Hosts and Services is the server monitoring?

First, upgrade XI to the latest version.
Run the manual XI upgrade from the instructions in this document.
https://assets.nagios.com/downloads/nag ... ctions.pdf

Login to the XI interface and go to the Admin > System Settings menu and verify the Program URI is correct.

If the upgrade fails, get the following configuration files and post them.

Code: Select all

/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/nagiosxi.conf
/etc/httpd/conf.d/ssl.conf
/etc/php.ini
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
Maxwellb99
Posts: 97
Joined: Tue Jan 26, 2016 5:29 pm

Re: API page has HTTP ERROR 500

Post by Maxwellb99 »

Hi OP,

We hit up against the same issue. We had to increase the PHP memory_limit. Here's what they told me. Basically in /etc/php.ini find "memory_limit" increase it & restart httpd. Hope this helps.

"
There isn't a maximum, however you are likely hitting a php memory_limit

edit /etc/php.ini and increase the memory_limit
CODE: SELECT ALL
memory_limit = 256M


restart httpd
CODE: SELECT ALL
service httpd restart
"
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: API page has HTTP ERROR 500

Post by optionstechnology »

Yes @Maxwellb99, that's exactly it!

Thanks!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: API page has HTTP ERROR 500

Post by lmiltchev »

Thanks @Maxwellb99!

@optionstechnology, is it safe to close this topic now, and mark it as resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: API page has HTTP ERROR 500

Post by optionstechnology »

yup
Locked