Nagios XI 5.4.3 Rest API error 500

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

Nagios XI 5.4.3 Rest API error 500

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios XI 5.4.3 Rest API error 500

Post by mcapra »

Have you tried upping some of your PHP settings? Specifically, try doubling whatever the current memory_limit is on your system:

Code: Select all

memory_limit = 128M
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
Former Nagios employee
https://www.mcapra.com/
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

Re: Nagios XI 5.4.3 Rest API error 500

Post 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!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios XI 5.4.3 Rest API error 500

Post 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.
Former Nagios employee
https://www.mcapra.com/
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

Re: Nagios XI 5.4.3 Rest API error 500

Post 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!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios XI 5.4.3 Rest API error 500

Post 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.
Locked