# 10.9 zookeeper集群监控

## System requirements

* [zabbix](http://www.zabbix.com/downloads/) >= 3.4 (preprocessing used by this template)
* [zookeeper](https://zookeeper.apache.org/releases.html) >= 3.4 (mntr stats)
* netcat&#x20;
* zookeeper监控模板，被监控主机，记得添加nc命令

## Features

* ruok check
* mntr stats :
  * zk\_num\_alive\_connections
  * zk\_approximate\_data\_size
  * zk\_ephemerals\_count
  * zk\_min\_latency
  * zk\_avg\_latency
  * zk\_max\_latency
  * zk\_max\_file\_descriptor\_count
  * zk\_open\_file\_descriptor\_count
  * zk\_outstanding\_requests
  * zk\_packets\_received
  * zk\_packets\_sent
  * zk\_server\_state
  * zk\_version
  * zk\_znode\_count
* graphs
* screen

## Zabbix Macros

* {$ZOO\_IP} : IP of the Zookeeper Instance (default : 127.0.0.1)
* {$ZOO\_PORT} : Port of the Zookeeper Instance (default : 2181)

## Zabbix Configuration

1\) Copy `UserParameter_Zookeeper.conf` to `/etc/zabbix/zabbix_agentd.d` folder (or whatever is default and/or configured on your system).

2\) Restart your Zabbix Agent

3\) Import XML template file (`zookeeper.xml`) into Zabbix via Web GUI (Configuration -> Templates -> Import).

4\) Assign the imported template to a host, change MACROS if needed in the host parameters and enjoy!
