Skip to main content Skip to complementary content

Monitoring an Apache ActiveMQ broker with Nagios

Before you begin

The process is to start an Apache ActiveMQ standalone broker on the jolokia_host machine, and then monitor it on the Nagios machine. The Jolokia agent (JAR file) has been already integrated into the ActiveMQ distribution which is included in Talend ESB.

Information noteNote: For more details on running and configuring Apache ActiveMQ, see Talend ESB Infrastructure Services Configuration Guide.


  1. On the jolokia_host machine, we start the Apache ActiveMQ standalone broker which is to be monitored; in a command console:
    • cd <TalendRuntimePath>/activemq/bin/activemq console (Linux*)
    • cd <TalendRuntimePath>/activemq/bin/activemq (Windows)

    The Apache ActiveMQ broker should now be running.

    Information noteNote: The "console" option in Linux runs the broker in the foreground; the default is to run it in the background.
  2. You can view this using the Web Console at http://localhost:8161/admin/; if you access the URL http://localhost:8161/jolokia/version, you will see a JSON output line about version information, which indicates the Jolokia agent is running correctly.
    We use this Web Console to define information to be monitored - these correspond to pre-configured entries in the check command in the Talend ESB configuration <TalendRuntimePath>/add-ons/adapters/nagios/template/activemq_host.cfg.
  3. Create a Queue with the name example.A.
  4. Create a Topic with the name ActiveMQ.Advisory.Consumer.Queue.example.A.

What to do next

Now we configure the Nagios machine to do the monitoring:

  1. Check that the value of jolokia_host in /etc/hosts corresponds to the machine running the Apache ActiveMQ broker, for example: jolokia_host
  2. Copy the configuration files activemq.cfg, activemq_host.cfg and jmx_commands.cfg from the <TalendRuntimePath>/add-ons/adapters/nagios/template directory to the Nagios configuration folder, for example: /usr/local/nagios/etc/objects/ or /etc/nagios3/etc/objects/

    See Syntax for adding metrics for monitoring for details of the check definitions, command definitions and other configuration details for ActiveMQ which are pre-defined in these files.

  3. Edit nagios.cfg and add:
    These paths may be different, depending on your version of Nagios.
  4. Define macros which will be used by jmx_commands.cfg in the existing resource.cfg; here are some examples, which depend on where your installation puts config files:
    • In /usr/local/nagios/etc/resource.cfg add these lines:
      # set the path which jmx4perl plugin installed
      # set the path to where to find configuration files
    • Or in /etc/nagios3/resource.cfg add these lines:
      # set the path which jmx4perl plugin installed
      # set the path to where to find configuration files
  5. Then, restart Nagios for the changes to take effect.
    # service nagios restart
    Information noteNote: The name of this service may vary, depending on which package you used to install Nagios, so it may be called, for example, nagios3, instead of nagios.
  6. Finally, Login to the Nagios Web Interface http://<nagios_host>/<nagios_server>/ for example: http://localhost/nagios/, or, and select services. There, you will find the status of metrics for ActiveMQ.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!