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.
Procedure
What to do next
Now we configure the Nagios machine to do the monitoring:
- 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
- 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.
- Edit nagios.cfg and add:
These paths may be different, depending on your version of Nagios.
cfg_file=/usr/local/nagios/etc/objects/activemq_host.cfg cfg_file=/usr/local/nagios/etc/objects/jmx_commands.cfg
- 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
- In /usr/local/nagios/etc/resource.cfg add these
lines:
- 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. - 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.