Monitoring an Apache ActiveMQ broker with Nagios - 8.0

Talend ESB System Management Integration User Guide

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Administration and Monitoring
Installation and Upgrade
Last publication date
2024-02-06

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.

Note: For more details on running and configuring Apache ActiveMQ, see ActiveMQ.

Procedure

  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.

    Note: 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:
    192.168.1.101 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:
    cfg_file=/usr/local/nagios/etc/objects/activemq_host.cfg
    cfg_file=/usr/local/nagios/etc/objects/jmx_commands.cfg
    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
      $USER5$=/usr/local/src/jmx4perl/scripts
      # set the path to where to find configuration files
      $USER6$=/usr/local/nagios/etc/objects
    • Or in /etc/nagios3/resource.cfg add these lines:
      # set the path which jmx4perl plugin installed
      $USER5$=/usr/local/src/jmx4perl/scripts
      # set the path to where to find configuration files
      $USER6$=/etc/nagios3/etc/objects
  5. Then, restart Nagios for the changes to take effect.
    # service nagios restart
    Note: 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/, http://192.168.1.10/nagios3/ or http://192.168.198.5/nagios/, and select services. There, you will find the status of metrics for ActiveMQ.