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.
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*)
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.
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
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.
- Create a Queue with the name example.A.
Create a Topic with the name
What to do next
Now we configure the Nagios machine to do the monitoring:
- Check that the value of
jolokia_hostin /etc/hosts corresponds to the machine running the Apache ActiveMQ broker, for example:
- Copy the configuration files activemq.cfg,
activemq_host.cfg and jmx_commands.cfg from
directory to the Nagios configuration folder, for example:
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.
- Edit nagios.cfg and add:
These paths may be different, depending on your version of Nagios.
- 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
# 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
- In /usr/local/nagios/etc/resource.cfg add these lines:
- Then, restart Nagios for the changes to take
# service nagios restartNote: 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
- 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.