An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by meganwilliford »

I've run into an error I have not seen yet. NCPA checks are working for CPU, Memory, and Disk however, any checks verifying service status is coming back as "An error occurred:HTTP Error 500: INTERNAL SERVER ERROR". The remote server is RHEL 6.10 using NCPA 2.1.9.

Results from the nagios server command line:

[root@nagiosserver ~]# /usr/local/nagios/libexec/check_ncpa.py -H [remoteserver] -t 'generictoken' -P 5693 -M 'services' -q 'service=ncpa_listener,status=running' -v
Connecting to: https://[remoteserver]:5693/api/services/?token=generictoken&check=1&service=ncpa_listener&status=running
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

I've also tested the ncpa connection using https://[remoteserver]:5693/testconnect/?token=generictoken and the value: "Success."

Any ideas on what the issue might be?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by lmiltchev »

Can you post the ncpa.cfg and ncpa_listener.log? Also, run the following commands and show the output:

On the remote box:

Code: Select all

cat /etc/*release
which python
python --version
On the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H [remoteserver] -t 'generictoken' -P 5693 -M 'services' -l -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by meganwilliford »

Attached is the ncpa_listener.log, ncpa.cfg, and troubleshooting text file with the command outputs. I ran a similar command for processes from the Nagios XI server and had no issues: /usr/local/nagios/libexec/check_ncpa.py -H [remoteserver] -t 'generictoken' -P 5693 -M 'processes' -l -v.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by lmiltchev »

I am not sure what 'nails' is, but I see permission issues in the log:
2019-11-04 10:31:27,068 20131 ERROR [Errno 13] Permission denied: '/etc/init.d/nails'
In el6 in order to get currently running services, NCPA checks the init.d files. Let's check the permissions on these. Run the following command on the client and show the output:

Code: Select all

ls -lad /etc/init.d
ls -la /etc/init.d
umask
sestatus
Can you view the services if you change:

Code: Select all

uid = nagios
gid = nagios
to:

Code: Select all

uid = root
gid = root
and restart the ncpa_listener service?

Are you using IPv4, IPv6 or both on this system?
Be sure to check out our Knowledgebase for helpful articles and solutions!
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by meganwilliford »

Attached is the output of the permissions.

Changing the uid and gid to root worked. I was able to list all of the services.

IPv4 is used.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR

Post by lmiltchev »

I am able to list all of the services on my test RHEL machine, even with:

Code: Select all

uid = nagios
gid = nagios
I wonder if you made any changes to the system, in order to harden the server...

Note: I meant to ask you to run:

Code: Select all

ls -la /etc/init.d/
or

Code: Select all

cd /etc/init.d/
ls -la
not this:

Code: Select all

ls -la /etc/init.d
Sorry about that. I wanted to see the permissions of the files under the /etc/init.d/ directory.
Changing the uid and gid to root worked. I was able to list all of the services.
I am glad to hear that! Is this a "workaround" that you would consider? Is it safe to close this topic?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked