ZhangJian He 9a2dc253ca ZOOKEEPER-4834. fix typos in Apache ZooKeeper (#2167) 9 months ago
..
cacti 9a2dc253ca ZOOKEEPER-4834. fix typos in Apache ZooKeeper (#2167) 9 months ago
ganglia ee994fbca5 ZOOKEEPER-4830. Replace references to zk_followers (#2160) 1 year ago
nagios 9a2dc253ca ZOOKEEPER-4834. fix typos in Apache ZooKeeper (#2167) 9 months ago
JMX-RESOURCES b0df8fe1e1 ZOOKEEPER-3030: MAVEN MIGRATION - Step 1.3 - move contrib directories 6 years ago
README b0df8fe1e1 ZOOKEEPER-3030: MAVEN MIGRATION - Step 1.3 - move contrib directories 6 years ago
check_zookeeper.py 9a2dc253ca ZOOKEEPER-4834. fix typos in Apache ZooKeeper (#2167) 9 months ago
test.py b0df8fe1e1 ZOOKEEPER-3030: MAVEN MIGRATION - Step 1.3 - move contrib directories 6 years ago

README


Tools and Recipes for ZooKeeper Monitoring
------------------------------------------

How To Monitor
--------------

A ZooKeeper cluster can be monitored in two ways:
1. by using the 'mntr' 4letterword command
2. by using JMX to query the MBeans

This repo contains tools and recipes for monitoring ZooKeeper using the first method.

Check the file JMX-RESOURCE for some links to resources that could help you monitor a ZooKeeper cluster using the JMX interface.

Requirements
------------

ZooKeeper 3.4.0 or later or you can apply ZOOKEEPER-744 patch over the latest 3.3.x release.
The server should understand the 'mntr' 4letterword command.

$ echo 'mntr' | nc localhost 2181
zk_version 3.4.0--1, built on 06/19/2010 15:07 GMT
zk_avg_latency 141
zk_max_latency 1788
zk_min_latency 0
zk_packets_received 385466
zk_packets_sent 435364
zk_num_alive_connections 1
zk_outstanding_requests 0
zk_server_state follower
zk_znode_count 5
zk_watch_count 0
zk_ephemerals_count 0
zk_approximate_data_size 41
zk_open_file_descriptor_count 20
zk_max_file_descriptor_count 1024

Python 2.6 (maybe it works on previous version but it's not tested yet).

In a nutshell
-------------

All you need is check_zookeeper.py It has no external dependencies.


*** On Nagios call the script like this:

./check_zookeeper.py -o nagios -s "" -k -w -c


*** On Cacti define a custom data input method using the script like this:

./check_zookeeper.py -o cacti -s "" -k --leader

-- outputs a single value for the given key fetched from the cluster leader

OR

./check_zookeeper.py -o cacti -s "" -k

-- outputs multiple values on for each cluster node
ex: localhost_2182:0 localhost_2183:0 localhost_2181:0 localhost_2184:0 localhost_2185:0

*** On Ganglia:

install the plugin found in the ganglia/ subfolder OR

./check_zookeeper.py -o ganglia -s ""

it will use gmetric to send zookeeper node status data.


Check the subfolders for configuration details and samples for each platform.

License
-------

Apache License 2.0 or later.

ZooKeeper 4letterwords Commands
-------------------------------

http://zookeeper.apache.org/docs/current/zookeeperAdmin.html#sc_zkCommands