Page 2 of 2

Re: JBoss check problem

Posted: Mon Jul 13, 2020 7:05 am
by hbouma
Ok, now we are getting somewhere.

For some reason, Wildfly is refusing the connection. I will have to research on my side what is going on.

Thanks

Re: JBoss check problem

Posted: Tue Jul 14, 2020 12:50 pm
by ssax
Sorry, I had a mistake in the ncpa.cfg entry, here's what worked for mine:

Code: Select all

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

Code: Select all

.jar = java -Djava.class.path=/opt/wildfly/bin/client/jboss-cli-client.jar:$plugin_name GenericASCheck $plugin_args
This is what works directly from the wildfly server:

Code: Select all

su - nagios
cd /usr/local/ncpa/plugins
java -Djava.class.path=/opt/wildfly-19.0.0.Final/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:'
Does that work for you?

Re: JBoss check problem

Posted: Tue Aug 11, 2020 12:17 pm
by hbouma
Once I changed the nagios user to have permissions to read from our DOMAIN/tmp/auth folder, this method worked.

Thank you!

Re: JBoss check problem

Posted: Tue Aug 11, 2020 12:38 pm
by hbouma
Also, is there a way to monitor the DB connections with this jar? For instance, to alert if the datasource is out of connections?

Re: JBoss check problem

Posted: Wed Aug 12, 2020 1:06 pm
by ssax
I don't think you can do it with this plugin, here is a list of what the plugin supports, see the check-types section:

Code: Select all

[root@jboss_wildfly plugins]#  java -Djava.class.path=/opt/wildfly/bin/client/jboss-cli-client.jar:check_jvm.jar GenericASCheck                                                                                                               -h
usage: check_jvm.jar [-c <arg>] [-C <arg>] [-h] [-p <arg>] [-s <arg>] [-t
       <arg>] [-u <arg>] [-v] [-w <arg>]
Monitor an application server (Tomcat, JBoss/Wildfly, Jetty, GlassFish)
instance remotely via JMX.
 -c,--critical <arg>      A list of nagios critical threhsolds. At least
                          one of this and warning must be entered.
 -C,--check-types <arg>   A list of the checks that should be run. Valid
                          checks: Uptime, MemorySimpleNonHeap,
                          MemorySimpleHeap, MemoryEden, MemorySurvivor,
                          MemoryOld, MemoryCodeCache,
                          MemoryCompressedClass, MemoryMetaspace,
                          ClassCount, ThreadCount, ProcessCPUUsage, and
                          SystemCPUUsage. Tomcat servers also have the
                          checks RequestsPerMinute, BytesPerMinute,
                          BytesPerRequest, ErrorsPerMinute, and
                          ProcessingTimePerRequest. Note:
                          RequestsPerMinute, BytesPerMinute,
                          BytesPerRequest, ErrorsPerMinute, and
                          ProcessingTimePerRequest also require the name
                          of the relevant request processor. For example,
                          "RequestsPerMinute:http-nio-0.0.0.0-8080". For
                          rate-based checks, a negative value may be
                          returned after a counter is reset.
 -h,--help                Print this message and exit.
 -p,--password <arg>      A password to pass to the JMX connection (should
                          be used in conjunction with the username option
 -s,--service-url <arg>   The full JMX service URL of your JVM (defaults
                          to localhost). This will be similar to
                          'service:jmx:rmi:///jndi/rmi://<host>:<port>/jmx
                          rmi'
 -t,--server-type <arg>   The name of the server brand you're using.
                          Should be one of {tomcat, jboss, jetty,
                          glassfish, other}. Defaults to 'other'. Wildfly
                          users may use 'jboss'.
 -u,--username <arg>      A username to pass to the JMX connection (should
                          be used in conjunction with the password option
 -v,--version             Print the version information and exit.
 -w,--warning <arg>       A list of nagios warning thresholds. At least
                          one of this and critical must be entered.

Re: JBoss check problem

Posted: Wed Aug 12, 2020 2:18 pm
by hbouma
Thank you. That is all I needed.

Re: JBoss check problem

Posted: Thu Aug 13, 2020 6:49 am
by scottwilkerson
hbouma wrote:Thank you. That is all I needed.
Great!

Locking thread