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?
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
-
meganwilliford
- Posts: 101
- Joined: Tue Aug 06, 2019 7:49 am
Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
Can you post the ncpa.cfg and ncpa_listener.log? Also, run the following commands and show the output:
On the remote box:
On the Nagios XI server:
On the remote box:
Code: Select all
cat /etc/*release
which python
python --versionCode: Select all
/usr/local/nagios/libexec/check_ncpa.py -H [remoteserver] -t 'generictoken' -P 5693 -M 'services' -l -vBe 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
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.
Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
I am not sure what 'nails' is, but I see permission issues in the log:
Can you view the services if you change:
to:
and restart the ncpa_listener service?
Are you using IPv4, IPv6 or both on this system?
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:2019-11-04 10:31:27,068 20131 ERROR [Errno 13] Permission denied: '/etc/init.d/nails'
Code: Select all
ls -lad /etc/init.d
ls -la /etc/init.d
umask
sestatusCode: Select all
uid = nagios
gid = nagiosCode: Select all
uid = root
gid = rootAre 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
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.
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.
Re: An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
I am able to list all of the services on my test RHEL machine, even with:
I wonder if you made any changes to the system, in order to harden the server...
Note: I meant to ask you to run:
or
not this:
Sorry about that. I wanted to see the permissions of the files under the /etc/init.d/ directory.
Code: Select all
uid = nagios
gid = nagiosNote: I meant to ask you to run:
Code: Select all
ls -la /etc/init.d/Code: Select all
cd /etc/init.d/
ls -laCode: Select all
ls -la /etc/init.dI am glad to hear that! Is this a "workaround" that you would consider? Is it safe to close this topic?Changing the uid and gid to root worked. I was able to list all of the services.
Be sure to check out our Knowledgebase for helpful articles and solutions!