We are getting a 500 internal server error for an API Object Reference on a few of our Nagios XI instances. However on the same Nagios XI instances other API Object References are available with no issues. Any ideas on why we wouldn't be able to reach the Objects Service API on some of the Nagios XI instances?
Nagios XI Host 1
500 Internal Server Error:
https://<nagios_host_1>/nagiosxi/api/v1/objects/service?apikey=X
Successful:
https://<nagios_host_1>/nagiosxi/api/v1/objects/statehistory?apikey=X
Nagios XI Host 2
Successful:
https://<nagios_host_2>/nagiosxi/api/v1/objects/service?apikey=X
Successful:
https://<nagios_host_2>/nagiosxi/api/v1/objects/statehistory?apikey=X
API 500 Internal Server Error
Re: API 500 Internal Server Error
I'm wondering if you have some crashed tables...
Please send the output of these commands (as root):
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password
Please send me a copy of your profile, you can download it from Admin > System Profile > Download Profile.
Run this command (as root) and leave it running:
Then replicate the 500 error again and send the full output of the still running tail command above.
Please send the output of these commands (as root):
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password
Code: Select all
echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --tablePlease send me a copy of your profile, you can download it from Admin > System Profile > Download Profile.
Run this command (as root) and leave it running:
Code: Select all
tail -Fn0 /var/log/httpd/error_log /var/log/httpd/ssl_error_log-
dbcummings
- Posts: 130
- Joined: Thu Dec 13, 2018 8:37 am
Re: API 500 Internal Server Error
PM sent with requested data.
Re: API 500 Internal Server Error
Are all XI systems the same version?
I see you have a crashed table (not our table though):
Please repair it (I would also recommend you not add custom tables to our databases, we don't account for them in our scripts, create a different database for custom stuff):
I'm not seeing anything in your logs showing issues.
Please send me your /etc/php.ini from a non-working one.
I see you have a crashed table (not our table though):
Code: Select all
| nagios_XXXXXXXXXXXX_view | NULL |Code: Select all
https://support.nagios.com/kb/article.php?id=24Please send me your /etc/php.ini from a non-working one.
-
dbcummings
- Posts: 130
- Joined: Thu Dec 13, 2018 8:37 am
Re: API 500 Internal Server Error
php.ini submitted via pm.
Re: API 500 Internal Server Error
Please edit your /etc/php.ini and change these:
To these:
Then restart apache on it and test the API call again:
Let us know the results.
Code: Select all
max_execution_time = 60
max_input_time = 120
max_input_vars = 5000
memory_limit = 256MCode: Select all
max_execution_time = 300
max_input_time = 300
max_input_vars = 100000
memory_limit = 1024MCode: Select all
service httpd restart