Page 1 of 2

JBoss check problem

Posted: Thu Jun 25, 2020 1:21 pm
by hbouma
We are running Nagios XI 5.6.10 on RHEL VM's. Trying to monitor some Wildfly 19 installs.

I went through the Configuration Wizard for JBoss/Wildfly. Placed the check_jvm.jar in the /usr/local/ncpa/plugins folder of our remote server.

Code: Select all

-rwxr-xr-x. 1 nagios nagios  49K Jun 19 08:32 check_jvm.jar
I have edited the ncpa.cfg as indicated in the guide (XXXXXXXXXXXXX is the location on disk of our Wildfly jboss-client.jar file)

Code: Select all

.jar = java -Djava.class.path=/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:$plugin_name GenericASCheck $plugin_args
When i run the check, I get the following errors:
UNKNOWN: Failed to connect: Operation failed with status WAITING

The check arguments seem correct:
-t TOKEN-P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:remote+http://SERVER:PORT,args=-u 'USERNAME',args=-p 'PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"

I don't know if part of the problem is that the password has a special character in it, but the GUI automatically escaped the special character with a \

Any help would be appreciated. This is our first time monitoring Wildfly and need to get it setup in a hurry.

Re: JBoss check problem

Posted: Fri Jun 26, 2020 12:47 pm
by ssax
If you run it from the command line of the XI server, does it work? Please test that first with the exact formatting like the command below. Are you using 9990 as the port or something else? 9990 should be the default.

I just tested and it's working on mine, please send me the full output of yours with the --debug option appended to the command for debugging:
- This is the exact command that I used that works

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X --debug -t 'YOURTOKEN' -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:remote+http://127.0.0.1:9990,args=-u 'USERNAME',args=-p 'PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"

Re: JBoss check problem

Posted: Fri Jun 26, 2020 1:06 pm
by hbouma
PM sent.

Re: JBoss check problem

Posted: Fri Jun 26, 2020 5:36 pm
by ssax
PM responded.

Re: JBoss check problem

Posted: Mon Jul 06, 2020 9:08 am
by hbouma
Hi,

I received your reply and replied with the provided information.

Re: JBoss check problem

Posted: Tue Jul 07, 2020 9:36 am
by ssax
I labbed this up and I'm getting the same thing. I'm trying to find a resolution, if you don't hear from me by end of day today, please update this post so it pops up on our dashboard as we're pretty busy and I have three remote sessions so I don't have a lot of time today.

Re: JBoss check problem

Posted: Wed Jul 08, 2020 10:33 am
by hbouma
Hi, just checking in on this.

Re: JBoss check problem

Posted: Thu Jul 09, 2020 5:38 pm
by ssax
Try changing it from remote+http to http-remoting:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X --debug -t 'YOURTOKEN' -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:http-remoting://127.0.0.1:9990,args=-u 'USERNAME',args=-p 'PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"
Also, try using the IP address instead of 127.0.0.1, maybe it's only listening on a certain IP.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X --debug -t 'YOURTOKEN' -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:remote+http://X.X.X.X:9990,args=-u 'USERNAME',args=-p 'PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"
Do either of those work?

Re: JBoss check problem

Posted: Fri Jul 10, 2020 6:43 am
by hbouma
I tried as you suggested. Unfortunately, that is an unsupported protocol.


/usr/local/nagios/libexec/check_ncpa.py -H SERVER_NAME-t SECRET_TOKEN -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:http-remoting://IP_ADDRESS:9990,args=-u 'OUR_USERNAME',args=-p 'SECRET_PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"
UNKNOWN: Failed to connect: Unsupported protocol: http-remoting

I can hit this with the jconsole JMX browser and have verified connectivity to the box from Nagios when using remote+http

Re: JBoss check problem

Posted: Fri Jul 10, 2020 3:00 pm
by ssax
Please run this one on from the Wildfly server, this one worked on mine with remote+http and the jboss-cli-client, does it work for yours?
- Change your wildfly path if it differs

Code: Select all

java -Djava.class.path=/opt/wildfly/bin/client/jboss-cli-client.jar:check_jvm.jar GenericASCheck -s 'service:jmx:remote+http://127.0.0.1:9990' -t jboss -C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime' -w '17179869184,34359738368,50,70,1500000:' -c '32212254720,68719476736,70,90,300000:'
If that works try changing your ncpa.cfg on the Wildfly server to this:
- Change your wildfly path if it differs
- Note that it's using jboss-cli-client.jar

Code: Select all

.jar = java java -Djava.class.path=/opt/wildfly/bin/client/jboss-cli-client.jar:$plugin_name GenericASCheck $plugin_args
Then restart the ncpa_listener and ncpa_passive services on the Wildfly server and test again:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'YOURTOKEN' -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:remote+http://127.0.0.1:9990,args=-u 'USERNAME',args=-p 'PASSWORD',args=-t jboss,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"