Monitor Apache ActiveMQ's health, queuesizes and subscribers. The plugin makes use of the Jolokia REST interface.
nagiosplugin is a Python Framework designed for Nagios Plugins written in Python.
It can be installed via pip
.
The plugin queries ActiveMQ using the new REST based Jolokia interface.
To use this plugin with an ActiveMQ version earlier than 5.8 you have too add Jolokia support manually.
With version 5.9.1 of ActiveMQ, the Hawtio console was removed.
If you run a version of ActiveMQ that still includes Hawtio,
you need to supply the --url-tail "hawtio/jolokia/read"
parameter to the plugin.
For releases without Hawtio, this paramter can be omitted and defaults to api/jolokia/read
.
cd /usr/lib/nagios/plugins/
wget https://raw.githubusercontent.com/predic8/activemq-nagios-plugin/master/check_activemq.py
pip install nagiosplugin
(systemwide, execute as root) orpip install --user nagiosplugin
(for the current user)./check_activemq.py -h
to see the full (and up to date) help--host
specifies the Hostname of the ActiveMQ broker--port
specifies the Port--user
specifies the Username of ActiveMQ's Web Console--pwd
specifies the PasswordThis Plugin currently support 4 different checks listed below. All checks return UNKNOWN if the broker isn't reachable on the network.
-w WARN
specifies the Warning threshold (default 10)-c CRIT
specifies the Critical threshold (default 100)QUEUE
- specify queue name to check (see additional explanations below)*
and ?
--clientId
specifies a client ID--topic
specifies a topic of the ActiveMQ BrokerclientId
is an inactive Subscriber.name
exists.--name
specifies a Queue or Topic namename
exist.Pending Queue Size
and the clientId
for a given subscription
.--subscription
specifies the name of a subscription--clientId
specifies a client IDclientId
is not the Client Id of the given subscription.--prefix PREFIX
- specify DLQ prefix, all queues with a matching prefix will be checked (default 'ActiveMQ.DLQ.')--cachedir CACHEDIR
- specify base directory for state file (default '~/.cache')CACHEDIR/activemq-nagios-plugin/dlq-cache.json
'No additional messages in ActiveMQ.DLQ.Test'=0
)
the =0
means that there are 0
additional messages since the last check,
it does NOT mean that there are 0
messages in the queue. (Use queuesize
if you want to check this.)./check_activemq.py queuesize TEST
./check_activemq.py -w 30 -c 100 queuesize "TEST*"
./check_activemq.py health
Spongebob
is a subscriber of BikiniBottom
./check_activemq.py subscriber --clientId Spongebob --topic BikiniBottom
./check_activemq.py exists --name someQueueName
./check_activemq.py exists --name someTopicName
./check_activemq.py dlq --prefix 'DLQ.''