How to use check_jmx4perl to monitor with JBoss Fuse/AMQ 6.1.x, 6.2.x

Solution In Progress - Updated -

Environment

  • JBoss Fuse
    • 6.1

Issue

We need to monitor JBoss Fuse/A-MQ with checkmk (a nagios clone).

It is monitoring an existing EAP application by deploying jolokia and then using the http protocol / REST-interface with the nagios plugin compliant perl based executable check_jmx4perl:
https://jolokia.org/client/perl.html

The approach is described:
http://giallone.blogspot.de/2014/01/monitoring-jboss-fuse-esb-with-nagios.html

Obviously the same approach for JBoss A-MQ and Fuse will be used, especially since the embedded hawtio/jolokia application exposes A-MQ/Fuse MBeans via REST/http out of the box.

The problem arises with the HTTP return code of the A-MQ container for authentication being 403 rather than 401 as described here:
https://github.com/hawtio/hawtio/issues/1155

I have tried patching upto r2p2 and separately the more recent r2p3 and have added:

hawtio.noCredentials401=true

to the system properties but the problem remains.

Can a patch be provided to enable monitoring of A-MQ 6.1 and Fuse 6.0 via nagios/checkmk using check_jmx4perl?

Resolution

  • Upgrade JBoss Fuse 6.1 to patch level R2P5 or later.
  • Upgrade to JBoss Fuse 6.2.

In addition, adding following properties to "etc/system.properties" file is no longer needed for the check_jmx4perl solution:

hawtio.rolePrincipalClasses=org.apache.karaf.jaas.boot.principal.RolePrincipal,org.apache.karaf.jaas.modules.RolePrincipal
hawtio.noCredentials401=true

Please note, there is an issue with check_jmx4perl as it does not send "Authorization" HTTP header when using "--user admin --password admin" options. In order to get it to work, you will need to add "user/password" to the URL like:

http://<user>:<passowrd>@<hostname>:<port>/...

For instance, this command will work:

check_jmx4perl --url http://admin:admin@localhost:8181/hawtio/jolokia --name "[MyService - CamelContext - WebService]" --mbean "org.apache.camel:context=mycontext/86-MyRoute.Request,name=\"log\",type=components" --attribute "State" --critical Stopped --warning Started

while this command will fail with HTTP 403 Forbidden:

check_jmx4perl --user admin --password admin --url http://localhost:8181/hawtio/jolokia --name "[MyService - CamelContext - WebService]" --mbean "org.apache.camel:context=mycontext/86-MyRoute.Request,name=\"log\",type=components" --attribute "State" --critical Stopped --warning Started

Root Cause

This issue is tracked by the JIRA:
ENTESB-3154

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments