Page 1 of 1
Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 12:16 pm
by bennyboy
Hi,
I need that rest api to be working. We need it to autmate the host and services creation.
HOST
https://nagios.domain.com/nagiosxi/api/ ... y&pretty=1 return a host list as expected.
SERVICES
https://nagios.domain.com/nagiosxi/api/ ... y&pretty=1 return error 500. I use it successfully couple hour ago. I think I add somthing the API don't like.
Can you help me to troubleshoot that please.
Re: Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 12:33 pm
by mcapra
Have you tried upping some of your PHP settings? Specifically, try doubling whatever the current memory_limit is on your system:
Then do a
service httpd restart to apply the changes. If that doesn't fix the issue, can you share your apache logs with us? This command should put them in the
/tmp/43512_1.zip file:
Code: Select all
zip -r /tmp/43512_1.zip /var/log/httpd
Re: Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 12:51 pm
by bennyboy
I double the memory limit to 256M and it's working.
I have 8806 services and I plan to grow to +- 30 000 services.
Code: Select all
{
"servicelist": {
"recordcount": "8806",
"service": [
Nagios plan to optimize or give more option with the res api ?
It's really usefull for us.
Thank you!
Re: Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 12:55 pm
by mcapra
The REST API is a constant work in progress. The end goal of the REST API is to have it do "all the things", IE you could manage an entire Nagios XI installation via the REST API. It's not there yet, but that's the goal.
Re: Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 1:16 pm
by bennyboy
I just monitor the httpd process generating the result for rest api. I calculate 212M of ram. I have to increase that to 512M to handle more services. Do you have a chart to setup php memory_limit to handle 30 000 services ?
Thank you!
Re: Nagios XI 5.4.3 Rest API error 500
Posted: Tue Apr 18, 2017 1:35 pm
by dwhitfield
No, we do not have a chart for the PHP limit. Generally, people start to see issues with 20k-25k host+services. However, you may able to get past those barriers, using a variety of tools to increase performance.
If you're speaking specifically about PHP, then not everything uses the PHP memory limit. Depending on how much reporting and graphing you are doing, you may want to set that to 2048.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf will be an important document for you, and I *highly* recommend look at the links at the bottom of that document about passive checks and distributed monitoring.