check_xi_ncpa INTERNAL SERVER ERROR

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
AlexSavVl
Posts: 38
Joined: Wed Oct 24, 2018 5:50 am

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post by AlexSavVl »

The same problem with ncpa 2.1.1 and AIX 6.
AlexSavVl
Posts: 38
Joined: Wed Oct 24, 2018 5:50 am

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
AlexSavVl
Posts: 38
Joined: Wed Oct 24, 2018 5:50 am

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
AlexSavVl
Posts: 38
Joined: Wed Oct 24, 2018 5:50 am

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post 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!
AlexSavVl
Posts: 38
Joined: Wed Oct 24, 2018 5:50 am

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post by AlexSavVl »

It is not good for us to wait any longer. So do not worry. we will use ps scripts.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_xi_ncpa INTERNAL SERVER ERROR

Post by lmiltchev »

Noted. Let us know if you have any further questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked