Good Afternoon,
Have the check_tcp on the windows server under C:\Program Files (x86)\Nagios\NCPA\plugins
Running into error - UNKNOWN: An error occurred connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')
Here is $ARG1$ parameter - -t 'xxxx' -P 5693 -M 'plugins/check_tcp' -q 'args=-H [email protected] -p xx'
I believe my context in $ARG1$ needs to be modified, this plugin is working great on linux servers.
I do know that for the linux servers, i have to run chown nagios so my question is, could my error be due to permissions for the windows server?
Thanks for your help.
Check_TCP Plugin - Windows Server 2019
Re: Check_TCP Plugin - Windows Server 2019
Hello @DerekNagiosXI
Thanks for reaching out on 'check_tcp' plugin 500 error condition.
Want to verify that we are able to view the 'ncpa' web console:
To verify from Linux command line from your Nagios XI instance:
Allow hosts in the 'ncpa.cfg' configured to allow found in the /nagios/ncpa/etc/ directory:
Let us know how things look,
Perry
Thanks for reaching out on 'check_tcp' plugin 500 error condition.
Want to verify that we are able to view the 'ncpa' web console:
Code: Select all
https://yourwindowsserver2019:5693Code: Select all
curl -k https://yourwindowsserver2019:5693/api/plugins/check_tcp.exe?args=-H localhost&args=-p 5693&args=-c 22&args=-w 3Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourwindowsserver2019 -t welcome -M 'plugins/check_tcp' -q 'args= -H hosttocheckhere -p 5693'For testing purposes, I gave "everyone" full access permissions on the '/plugin/check_tcp'.allowed_hosts = xxx.xxx.xxx.0/24
Let us know how things look,
Perry
-
DerekNagiosXI
- Posts: 14
- Joined: Thu Apr 29, 2021 1:08 pm
Re: Check_TCP Plugin - Windows Server 2019
Thank you for the reply. Confirmed I am able to view NCPA web console.pbroste wrote:Hello @DerekNagiosXI
Thanks for reaching out on 'check_tcp' plugin 500 error condition.
Want to verify that we are able to view the 'ncpa' web console:
Code: Select all
https://yourwindowsserver2019:5693For raw api results:
To verify from Linux command line from your Nagios XI instance:Code: Select all
curl -k https://yourwindowsserver2019:5693/api/plugins/check_tcp.exe?args=-H localhost&args=-p 5693&args=-c 22&args=-w 3
Allow hosts in the 'ncpa.cfg' configured to allow found in the /nagios/ncpa/etc/ directory:Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourwindowsserver2019 -t welcome -M 'plugins/check_tcp' -q 'args= -H hosttocheckhere -p 5693'
For testing purposes, I gave "everyone" full access permissions on the '/plugin/check_tcp'.allowed_hosts = xxx.xxx.xxx.0/24
Let us know how things look,
Perry
Updated allow hosts in the ncpa.cfg and error message changed to
UNKNOWN: An error occured connecting to API. (HTTP error: '403 FORBIDDEN')
Verified token is correct.
Tried redownloading check_ncpa and replacing on my server. Please advise.
Re: Check_TCP Plugin - Windows Server 2019
Hello @DerekNagiosXI
Thanks for following up, what do you get for results on the command line and the option to add -v or --verbose to see more information.
Or if the plugin is in your '/nagios/libexec/.' on your server:
Let us know the results,
Perry
Thanks for following up, what do you get for results on the command line and the option to add -v or --verbose to see more information.
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourwindowsserver2019 -t welcome -M 'plugins/check_tcp' -q 'args= -H hosttocheckhere -p 5693' --verboseCode: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourwindowsserver2019 -t welcome -M 'check_tcp' -q 'args= -H hosttocheckhere -p 5693' --verbosePerry
-
DerekNagiosXI
- Posts: 14
- Joined: Thu Apr 29, 2021 1:08 pm
Re: Check_TCP Plugin - Windows Server 2019
Tried off the server, got
An error occurred:
UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')
An error occurred:
UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')
Re: Check_TCP Plugin - Windows Server 2019
Hello @DerekNagiosXI
Typical reasons to see 500 errors include; permissions, coding, and perhaps redirect issues.
To further dig let's verify:
Date and time are the same across.
Update the 'nagios' User Account:
Verify the user and the 'check_ncpa.py' command:
Results:
Results:
Run with 'nagios' User Account:
Results:
Once verified that the 'check_ncpa.py' and the 'check_tcp' each pass when execute separately. Then integrate the commands and run:
Thanks,
Perry
Typical reasons to see 500 errors include; permissions, coding, and perhaps redirect issues.
To further dig let's verify:
Date and time are the same across.
Update the 'nagios' User Account:
Code: Select all
chage -I -1 -m 0 -M 99999 -E -1 nagiosCode: Select all
whoamiList permissions:root
Code: Select all
ls -l /usr/local/nagios/libexec/check_ncpa.pySwitch to nagios User Account:-rwxr-xr-x. 1 apache nagios size mon day hh:mm /usr/local/nagios/libexec/check_ncpa.py
Code: Select all
su -l nagiosCode: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourhostyouarecheckinghere -VWe verified the 'check_ncpa.py'; now lets check via the Windows command that 'plugins/check_tcp' <yourargshere> passes. Also, test by adding 'Everyone' with full control.check_ncpa.py, Version 1.2.4
Once verified that the 'check_ncpa.py' and the 'check_tcp' each pass when execute separately. Then integrate the commands and run:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourwindowsserver2019 -t welcome -M 'plugins/check_tcp' -q 'args= -H hosttocheckhere -p 5693' --verbosePerry
