2 Replies Latest reply on Jun 14, 2010 6:55 AM by dave.stubbs

    How to access MQ statistics for remote monitoring

    dave.stubbs

      We have an MQ server in production, currently using HSJ but moving to an Oracle persistent back end. We have a central management application we use for our systems and we want to be able to enquire of MQ how many messages are pending on queues, and what queus exist on the server.

       

      We'd probably want poll every 5 to 10 seconds. We basically want to monitor to see that all the downstream systems are working and consuming messages as part of our systems resiliency design.

       

      The Advisory system would have been good enough if it were able to bublish on a regular interval a message with statistical information about the queues and the number of transactions on them, but there is nothing like that currently.

       

      Because we are using JMS there are no services (that I've found) within that framework that allow us to ask that question of the server, but are there mechanisms to ask that directly of the MQ server itself.

       

      If so, I'd appreciate some example code etc. and an explanation of how to go about it.

       

      Currently the MQ server doesn't impose any log in authentication on the Jetty front end, but that's one of the next things we'll be doing as well (in case that makes a difference).

       

      I know JMX can access stats, but we are using a remote application so not sure how that could/would work.

       

      Also I see there is a new statistics plugin for 5.3, not sure about how to use that either at the moment, I guess it's not a real time plugin either.

       

      Ideally I'd prefer for MQ to publish it's own stats to a queue if that were possible with a definable expiry date.

       

      Which also leads me on to another question, can we mix borkers, so for examepl , our critical data uses the JDBC database on the backend but the short lived stats would just use HSJ.

       

      Edited by: dave.stubbs on Feb 13, 2010 11:34 AM

        • 1. Re: How to access MQ statistics for remote monitoring
          garytully

          You can poll using JMX via ruby or java or perl, there are JMX client libs for most languages.

           

          But if you wish to use the JMS API, then the statistics plugin, which is real time, could be for you. It responds on the replyTo destination with the latest stats.

          http://activemq.apache.org/statisticsplugin.html

           

          I think you have identified a nice enhancement to the statistics plugins. An option that wold cause it to periodically output statistic information to a destination with an expiry, such that it could be picked up at any time. Alleviating the need to pool for it to happen.  This is something that could be considered in a future release.

           

          And, yes, you can mix and match broker configurations in a network, but not the stores used for destinations within a single broker.

          • 2. Re: How to access MQ statistics for remote monitoring
            dave.stubbs

            I managed to pull apart the JMX examples and get them working.

             

            MQ stats don't seem particularly reliable though, but at least I can get at them now.