JBoss check problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

JBoss check problem

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: JBoss check problem

Post 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:'"
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: JBoss check problem

Post by hbouma »

PM sent.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: JBoss check problem

Post by ssax »

PM responded.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: JBoss check problem

Post by hbouma »

Hi,

I received your reply and replied with the provided information.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: JBoss check problem

Post 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.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: JBoss check problem

Post by hbouma »

Hi, just checking in on this.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: JBoss check problem

Post 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?
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: JBoss check problem

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: JBoss check problem

Post 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:'"
Locked