Page 1 of 3
check_xi_ncpa INTERNAL SERVER ERROR
Posted: Tue Nov 13, 2018 7:14 am
by AlexSavVl
I have the same issue on windows. Client downloaded from Official site 2 weeks (ncpa-2.1.6.exe) ago and the bug looks like this
https://github.com/NagiosEnterprises/ncpa/issues/421
While checking processes:
ERROR:app:Exception on /api/processes [GET]
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
And from Nagios
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'processes' -q 'name=java.exe' -w 1
Connecting to: https://x.x.x.x:5693/api/processes/?token=test_token&warning=1&check=1&name=java.exe
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Tue Nov 13, 2018 2:19 pm
by scottwilkerson
Are you 100% sure you are running 2.1.6? I just downloaded it fresh on a windows machine and got the following output
Code: Select all
[root@localhost ~]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.5.215 -v -t 'nagiosxi' -P 5693 -M 'processes' -q 'name=java.exe' -w 1
Connecting to: https://192.168.5.215:5693/api/processes/?token=nagiosxi&warning=1&check=1&name=java.exe
File returned contained:
{
"perfdata": "'process_count'=0;1;;",
"returncode": 0,
"stdout": "OK: Process count for processes named java.exe was 0 | 'process_count'=0;1;;"
}
OK: Process count for processes named java.exe was 0 | 'process_count'=0;1;;
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Nov 14, 2018 2:15 am
by AlexSavVl
how do i check version from windows?
Yes, It works if java.exe is not an existing process.
"OK: Process count for processes named java.exe was 0
But if java.exe is running, I get the error.
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Nov 14, 2018 8:56 am
by scottwilkerson
AlexSavVl wrote:how do i check version from windows?
you can run this
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'system/version'
AlexSavVl wrote:Yes, It works if java.exe is not an existing process.
Code: Select all
OK: Process count for processes named java.exe was 0
But if java.exe is running, I get the error.
Hmm, I tested this with a running process (not java.exe) and I get expected results.
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Nov 14, 2018 9:40 am
by AlexSavVl
scottwilkerson wrote:AlexSavVl wrote:how do i check version from windows?
you can run this
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'system/version'
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'system/version'
OK: Version was ['6.1.7601']
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Nov 14, 2018 9:52 am
by AlexSavVl
scottwilkerson wrote:
Hmm, I tested this with a running process (not java.exe) and I get expected results.
Could you give me example?
In my case java.exe is running. java is absent. Services Netlogon is stopped and LanmanServer is running
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'processes' -q 'name=java.exe' -w 1
Connecting to: https://x.x.x.x:5693/api/processes/?token=test_token&warning=1&check=1&name=java.exe
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'processes' -q 'name=java' -w 1
OK: Process count for processes named java was 0 | 'process_count'=0;1;;
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'services' -q 'service=Netlogon,status=stopped'
OK: Netlogon is stopped
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'services' -q 'service=LanmanServer,status=running'
OK: LanmanServer is running
And process count is empty
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t my_token' -P 5693-M 'processes' --warning=100 --critical=200
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Nov 14, 2018 2:21 pm
by scottwilkerson
for example I ran
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.5.215 -t 'nagiosxi' -P 5693 -M 'processes' -q 'name=thunderbird.exe' -w 1
OK: Process count for processes named thunderbird.exe was 1 | 'process_count'=1;1;; 'cpu'=0.1%;;; 'memory'=1.33%;;; 'memory_vms'=0.4GB;;; 'memory_rss'=0.46GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
12352: thunderbird.exe: SWILKERSON9\swilkerson: 1.33 % (VMS 0.40 GB, RSS 0.46 GB): 0.10 %
Total Memory: 1.33 % (VMS 0.40 GB, RSS 0.46 GB)
Total CPU: 0.10 %
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.5.215 -t 'nagiosxi' -P 5693 -M 'processes' -w 200 -c 300
OK: Process count was 182 | 'process_count'=182;200;300; 'cpu'=99.85%;;; 'memory'=48.36%;;; 'memory_vms'=14.19GB;;; 'memory_rss'=16.6GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
0: System Idle Process: NT AUTHORITY\SYSTEM: 0.0 % (VMS 0.00 GB, RSS 0.00 GB): 97.01 %
4: System: NT AUTHORITY\SYSTEM: 0.03 % (VMS 0.00 GB, RSS 0.01 GB): 0.70 %
152: atiesrxx.exe: NT AUTHORITY\SYSTEM: 0.02 % (VMS 0.00 GB, RSS 0.01 GB): 0.00 %
384: smss.exe: NT AUTHORITY\SYSTEM: 0.0 % (VMS 0.00 GB, RSS 0.00 GB): 0.00 %
....
Total Memory: 48.36 % (VMS 14.19 GB, RSS 16.60 GB)
Total CPU: 99.85 %
Curious you aren't getting any results for the total processes but in the code you are missing a space between the port number and the -m
5693-M
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Nov 15, 2018 1:32 am
by AlexSavVl
Ok. Got an error after adding the space.
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'processes' --warning=100 --critical=200
Connecting to: https://x.x.x.x:5693/api/processes/?token=test_token&warning=100&critical=200&check=1
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'processes' -q 'name=svchost.exe' -w 1
Connecting to: https://x.x.x.x:5693/api/processes/?token=test_token&warning=1&check=1&name=svchost.exe
An error occurred:HTTP Error 500: INTERNAL SERVER ERROR
Im using windows server 2008
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Nov 15, 2018 8:39 am
by scottwilkerson
Were you able to confirm your version?
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'system/version'
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Nov 15, 2018 9:17 am
by AlexSavVl
Already. Windows 2008 server, as I wrote earlier
AlexSavVl wrote:scottwilkerson wrote:AlexSavVl wrote:how do i check version from windows?
you can run this
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -v -t 'test_token' -P 5693 -M 'system/version'
Code: Select all
$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'test_token' -P 5693 -M 'system/version'
OK: Version was ['6.1.7601']