4 Replies Latest reply on Feb 25, 2011 8:19 PM by Reid Morrison

    HornetQ monitoring with Nagios & Cacti

    drew dahlke Newbie

      Has anyone set up Nagios and/or Cacti monitoring on a standalone HornetQ instance? It would be great to see some sample templates so I don't have to write them from scratch.

        • 1. Re: HornetQ monitoring with Nagios & Cacti
          Clebert Suconic Master

          Maybe someone from the community? I'm not aware of anyone.


          Maybe you could be the first and share anything around it.

          • 2. Re: HornetQ monitoring with Nagios & Cacti
            Erik Beebe Newbie

            Hi Drew;


            I haven't created any Cacti templates yet, but have created some JMX monitors within Nagios.   Using check_jmx works great;  Here's an example to measure an alert on number of messages:


            /usr/local/nagios/libexec/check_jmx -U service:jmx:rmi:///jndi/rmi://SOMEHOST:SOMEPORT/jmxrmi -O org.hornetq:module=JMS,name=\"my_topic_name\",type=Topic  -A DurableMessageCount -vvvv -w 100 -c 200


            That's all there is to it.  To simplify monitoring a bunch of different objects, I made a simple wrapper script:


            [root@nagios libexec]# cat check_jmx_bean.sh











            /usr/local/nagios/libexec/check_jmx -U service:jmx:rmi:///jndi/rmi://$HOST:$PORT/jmxrmi -O "$OBJECT" -A $ATTRIBUTE -vvvv -w $WARN -c $CRIT


            .. and then add it to checkcommands.cfg like this:


            # check_jms command

            define command{

                     command_name    check_jmx_bean

                     command_line    $USER1$/check_jmx_bean.sh $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$



            .. and finally monitor like this:


            define service{

                    use                             generic-service         ; Name of service template to use

                    host_name                       my-hornet-server

                    service_description             my-hornet-server HornetQ instance

                    check_command                   check_jmx_bean!PORT!org.hornetq:module=JMS,name=\\"my_topic_name\\",type=Topic!DurableMessageCount!1000!5000

                    contact_groups                  admins



            Sorry if it's a little sloppy - I just made it about 10 minutes ago.  Hopefully this will help though.




            • 3. Re: HornetQ monitoring with Nagios & Cacti
              Erik Beebe Newbie

              As another aside.. an easy way to browse the jmx objects to monitor is to use jmxterm.  (You can google it and download - it's a single jar file).


              Run it like this:


              # java -jar jmxterm-1.0-alpha-4-uber.jar -l HOST:PORT


              .. you'll get a prompt, and can do stuff like this:


              $> beans

              #domain = org.hornetq:





              .. etc.  It's cool.  If you haven't already configured jmxremote for your JVM, that's obviously required - the instructions are in the HornetQ docs, and it's quick to set up.


              Good luck,


              • 4. HornetQ monitoring with Nagios & Cacti
                Reid Morrison Newbie

                We used to use Nagios and Cacti until we moved to a much more comprehensive and easier to use enterprise monitoring solution called Hyperic HQ. It is supported by VMWare. They have an open source, free, version that we are running to monitoring everything from Linux to HornetQ.


                Checkout Hyperic HQ Community Edition: http://www.hyperic.com/

                Then add the HornetQ monitoring plug-in: https://github.com/ClarityServices/hyperic-hornetq