# 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!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/10-zabbix/10.9-zookeeper-ji-qun-jian-kong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
