Wildfly Monitoring with NCPA Client

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Wildfly Monitoring with NCPA Client

Post by DanielKissel »

Hello Everyone,

I followed your PDF Guide to configure Wildfly Monitoring via the NCPA Client.

Sadly I am not able to get any Values into Nagios XI.

Everytime I run the Check from the Nagios XI Server i get this as response:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H ###MYIP#### -t ####MyTOKEN#### -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:http-remoting-jmx://###CorrectIPANDPORT#####,args=-u '##JbossUser###',args=-p '##JbossUserPsw###',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime,ClassCount,ThreadCount',args=-w '17179869184,34359738368,50,70,1500000:,10000,150',args=-c '32212254720,68719476736,70,90,300000:,50000,190'"
Fehler: Hauptklasse GenericASCheck konnte nicht gefunden oder geladen werden
Translation of the Error is that it can't load or find the MainClass GenericASCheck

The NCPA Client on the Machine is set like described in the PDF Tutorial and added the following line to the ncpa.cfg and the check_jvm.jar Plugin has been placed in the plugins folder of the ncpa client.

Code: Select all

.jar = java -Djava.class.path=C:\wildfly\bin\client\jboss-cli-client.jar:$plugin_name GenericASCheck $plugin_args
I tried it both with jboss-cli-client.jar and jboss-client.jar


When using Visual VM on the VM itself I can connect via JMX with no Problem to the Wildfly.

Our Wildfly is running on a Windows Machine.

Any help is highly appreciated :)

Kind regards
Daniel
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Re: Wildfly Monitoring with NCPA Client

Post by DanielKissel »

Just a little update from my side. I invested some time and get a result back when executing the following command from the PowerShell directly on the Windows Server where my Wildfly is running.

Console Output

Code: Select all

PS C:\ncpa\plugins> java -cp "C:\ncpa\plugins\jboss-cli-client.jar;C:\ncpa\plugins\check_jvm.jar" GenericASCheck -t jboss -s 'service:jmx:http-remoting-jmx://###IPandport###' -C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime' -w '17179869184,34359738368,50,70,1500000:,10000,150' -c '32212254720,68719476736,70,90,300000:,50000,190' -u ####Jbossuser### -p ####JbossPSW####

CRITICAL: 2 checks returned CRITICAL | jboss_heap=691502728B;17179869184;32212254720;; jboss_metaspace=227843144B;34359738368;68719476736;; jboss_process_cpu_usage=-100.0%;50;70;; jboss_s
ystem_cpu_usage=-100.0%;70;90;; jboss_uptime=68124862ms;1500000:;300000:;;
Heap-Allocated Memory returned OK with 659.47 MiB
Metaspace (non-heap) returned OK with 217.29 MiB
Process CPU usage returned CRITICAL with -100.0 %
System CPU usage returned CRITICAL with -100.0 %
Uptime returned OK with 18.92 hours
How could i get this into the ncpa.cfg to execute properly. I have tried different variants with no success.
Other question why does the HealthCheck return -100% CPU Usage? Is this a Bug?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Wildfly Monitoring with NCPA Client

Post by cdienger »

I'm not sure about the negative percentage at this point, but try this in the ncpa config:

Code: Select all

.jar = java -cp "C:\wildfly\bin\client\jboss-cli-client.jar;C:\ncpa\plugins\check_jvm.jar" GenericASCheck $plugin_args
and let us know if that gives you better results.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Re: Wildfly Monitoring with NCPA Client

Post by DanielKissel »

Hello,

this is the response from Nagios XI for the suggested NCPA Configuration

Code: Select all

UNKNOWN: Failed to connect: Unsupported protocol: http-remoting-jmx

These are some variants I have tried and commented in the ncpa.cfg with the results i had recieved from Nagios:

Code: Select all


#Here i copied the jboss-cli-client.jar to the plugins folder from the NCPA Agent
#.jar = java -cp "C:\ncpa\plugins\jboss-cli-client.jar;C:\ncpa\plugins\check_jvm.jar" GenericASCheck $plugin_args
# Result: UNKNOWN: Failed to connect: Unsupported protocol: http-remoting-jmx

#.jar = java -cp "C:\ncpa\plugins\jboss-cli-client.jar;$plugin_name" GenericASCheck $plugin_args
# Result: UNKNOWN: Failed to connect: Unsupported protocol: http-remoting-jmx

#.jar = java -cp "C:\ncpa\plugins\jboss-cli-client.jar;"$plugin_name GenericASCheck $plugin_args
#Result: Fehler: Hauptklasse C:\ncpa\plugins\check_jvm.jar konnte nicht gefunden oder geladen werden

Kind regards
Daniel
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Wildfly Monitoring with NCPA Client

Post by ssax »

Are you running this through docker for windows or do you have it directly installed on windows?

I want to lab it up and see what I find.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Wildfly Monitoring with NCPA Client

Post by cdienger »

The message "UNKNOWN: Failed to connect: Unsupported protocol: http-remoting-jmx" is an indicator that check_jvm.jar is getting loaded but jboss-cli-client.jar isn't. Java can be finicky when it comes to loading classes. Try this entry:

Code: Select all

.jar = java -cp "C:\wildfly\bin\client\jboss-cli-client.jar:C:\ncpa\plugins\check_jvm.jar" GenericASCheck $plugin_args
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Re: Wildfly Monitoring with NCPA Client

Post by DanielKissel »

Hello everyone,

Wildfly is installed directly on the Windows Server and is running as a Service via NSSM.

Kind regards
Daniel
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Re: Wildfly Monitoring with NCPA Client

Post by DanielKissel »

cdienger wrote:The message "UNKNOWN: Failed to connect: Unsupported protocol: http-remoting-jmx" is an indicator that check_jvm.jar is getting loaded but jboss-cli-client.jar isn't. Java can be finicky when it comes to loading classes. Try this entry:

Code: Select all

.jar = java -cp "C:\wildfly\bin\client\jboss-cli-client.jar:C:\ncpa\plugins\check_jvm.jar" GenericASCheck $plugin_args


When executing this the Result is, that the Main Class is not found

Code: Select all

.jar = java -cp "C:\ncpa\plugins\jboss-cli-client.jar:C:\ncpa\plugins\check_jvm.jar" GenericASCheck $plugin_args
#Result: Fehler: Hauptklasse GenericASCheck konnte nicht gefunden oder geladen werden
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Wildfly Monitoring with NCPA Client

Post by ssax »

What version of wildfly are you using?

For testing, can you try putting check_jvm.jar in your C:\Users\YOURUSER\ then change your ncpa entry to:

Code: Select all

.jar = java -cp "C:\wildfly\bin\client\jboss-cli-client.jar:check_jvm.jar" GenericASCheck $plugin_args
Then restart the NCPA service and test again and see if that works.

Is this path accurate?

Code: Select all

C:\wildfly\bin\client\jboss-cli-client.jar
DanielKissel
Posts: 14
Joined: Thu Aug 30, 2018 5:03 am

Re: Wildfly Monitoring with NCPA Client

Post by DanielKissel »

Hi,

i will try. Currently we are still running a Wildfly 12.

Wildfly is on our E:\ Partition. Just change from the C:\ Drive to E:\ Drive and your Path is correct.
Locked