The CHECK_JMX plugin, is a powerful tool that allows the execution of JMX queries. It supports the following parameters:
The following example shows how to monitor the memory usage of a JBOSS application server.
To configure the check, we can use both the XML or the INI configuration file.
<command name="CHECK_JBOSS_JMX" plugin_name="CHECK_JMX"> <arg name="url" value="service:jmx:remoting-jmx://$ARG1$" /> <arg name="object" value="java.lang:type=Memory" /> <arg name="attribute" value="HeapMemoryUsage" /> <arg name="warning" value="$ARG2$" /> <arg name="critical" value="$ARG3$" /> </command> <<Warning!!>> The url specified works only with JBOSS version 7.1 or greater. For older versions, please refer to the jboss manual.
CHECK_JBOSS_MEM : CHECK_JMX --url service:jmx:remoting-jmx://$ARG1$ --object java.lang:type=Memory --attribute HeapMemoryUsage -K used --warning $ARG2$ --critical $ARG3$
Warning!! The url specified works only with JBOSS version 7.1 or greater. For older versions, please refer to the jboss manual.
Any of the parameters ($ARG?$ macros) could be hardcoded inside the JNRPE configuration.
Warning!! To work with JBOSS version 7.1 or greater, the jboss-client.jar must be put inside the same directory of the CHECK_JMX plugin JAR file.
With the following invocation example we will rise a warning if the memory is beyond 50.000.000 bytes and a critical if it is beyond 70.000.000 bytes.
check_nrpe -n -H 127.0.0.1 -c CHECK_JBOSS_MEM -a localhost:9999 50000000 70000000