Page 3 of 3
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Wed Dec 05, 2018 1:07 pm
by lmiltchev
Bug report was created 16 days ago. We have problem with basic functionalyty in production installation.
Can I find out the approximate time to solve the problem?
Some of the bugs/features are difficult to implement, so it takes some time. I don't have an ETA on the bug fix at this time, but you can regularly check issue #509 on github for updates.
I dont know how to use powershell.
You can try something like this (as a starting point):
1. Create a simple PS script that would check for running processes, search for "java.exe", and check the last exit code from the search. If the exit code is 0, this means the java.exe is running, else - it's not running. The script will display is simple message.
check_java.ps1
Code: Select all
Get-WmiObject Win32_Process | findstr "java.exe" >$null 2>&1
if ($LastExitCode -eq 0) {
write-host "java.exe service is running"
exit 0
} else {
write-host "java.exe service is NOT running"
exit 2
}
2. Place the script in the NCPA plugins directory
3. Test it from the command line on the Nagios XI server.
Example:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'plugins/check_java.ps1'
java.exe service is running
If you needed to search for a longer string, e.g. part of the cmd, you could use something like this:
Code: Select all
classapth = "c:\\myWebProject\\apache-tomcat-8.5.35\\bin\\bootstrap.jar;c:\\myWebProject\\apache-tomcat-8.5.35\\bin\\tomcat-juli.jar"
Get-WmiObject Win32_Process -Filter "name = 'java.exe'" | Select-Object CommandLine | Out-String -Width 1024 | findstr "$classpath" >$null 2>&1
if ($LastExitCode -eq 0) {
write-host "java.exe service is running"
exit 0
} else {
write-host "java.exe service is NOT running"
exit 2
}
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Dec 06, 2018 2:06 am
by AlexSavVl
The same problem with ncpa 2.1.1 and AIX 6.
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Dec 06, 2018 2:42 am
by AlexSavVl
On AIX
Code: Select all
https://x.x.x.x:5693/api/processes/?token=test_token&check=1&name=java.exe
gives error 500
Code: Select all
https://x.x.x.x:5693/api/processes/?token=test_token&name=java.exe
gives data array
From https client all works until I set "Run as a Nagios Ccheck". On both - windows and AIX
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Thu Dec 06, 2018 10:08 am
by lmiltchev
You are probably having the same issue in AIX (with non-English characters that can't be parsed).
Can you post the entire ncpa_listener.log? Thanks!
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Fri Dec 07, 2018 1:31 am
by AlexSavVl
lmiltchev wrote:You are probably having the same issue in AIX (with non-English characters that can't be parsed).
Can you post the entire ncpa_listener.log? Thanks!
AIX if fully English. Log from windows attached higher. Don't worry about AIX. I just said that the problem persists in the old English client.
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Fri Dec 07, 2018 10:33 am
by lmiltchev
I was told by our developers that the 2.1.1 agent can't be patched as AIX 6 is no longer supported (EOL). As far as the problem with the Windows machine, you posted the issue on GitHub here:
https://github.com/NagiosEnterprises/ncpa/issues/509
Our developers will be working on it as soon as they can. You can check on the development directly on the GitHub page. Thank you!
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Mon Dec 10, 2018 1:21 am
by AlexSavVl
lmiltchev wrote:I was told by our developers that the 2.1.1 agent can't be patched as AIX 6 is no longer supported (EOL). As far as the problem with the Windows machine, you posted the issue on GitHub here:
https://github.com/NagiosEnterprises/ncpa/issues/509
Our developers will be working on it as soon as they can. You can check on the development directly on the GitHub page. Thank you!
Okey. No problem with AIX.
I posted Windows issue to GitHub 21 days ago.. Hope, the issue will be solved soon. Our production installation is waiting.
Thank you!
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Mon Dec 10, 2018 6:21 am
by AlexSavVl
It is not good for us to wait any longer. So do not worry. we will use ps scripts.
Re: check_xi_ncpa INTERNAL SERVER ERROR
Posted: Mon Dec 10, 2018 10:13 am
by lmiltchev
Noted. Let us know if you have any further questions.