Page 1 of 1

500 error when accessing Nagios API

Posted: Fri May 10, 2019 12:13 pm
by andrewatmacys
Version of Nagios is 5.4.13 on RHEL 7

When attempting to get host status, I'm getting a 500 error from the Nagios API:
nagios API2_LI.jpg
nagiosAPI.png
It was working not very long ago, a few days ago to my knowledge, so I'm not sure what might be causing a 500 internal server error.

Re: 500 error when accessing Nagios API

Posted: Fri May 10, 2019 12:34 pm
by andrewatmacys
I should note that when searching individually for hosts it works but not for all hosts.

Re: 500 error when accessing Nagios API

Posted: Fri May 10, 2019 2:21 pm
by tgriep
If the server has a lot of Hosts, you may have to increase some settings for PHP and Apache so the system can process them and allow you to display the data.

Edit the /etc/php.ini file and change the following from

Code: Select all

max_execution_time = 30
max_input_time = 60
memory_limit = 128M
to

Code: Select all

max_execution_time = 120
max_input_time = 240
memory_limit = 1024M
add this to the bottom of that file

Code: Select all

max_input_vars=50000
Save the file

Then edit this file

Code: Select all

/etc/httpd/conf/httpd.conf

Code: Select all

add this to the bottom of that file
LimitRequestLine 100000
Save the file and restart Apache for the changes to take affect.

Code: Select all

service httpd restart
If the above variables have been changed already on the server to values larger than the examples, increase them further.

Let us know if this works.