Sept 4, 2018
Altinity is happy to introduce a new tool in ClickHouse environment – Zabbix template for monitoring ClickHouse. It is open source and available on github
Let’s walk in details on how to install and setup this template.
The following tools are required to be installed before we can start:
Zabbixmonitoring platform. More details are available here
xmllist– command line XML tool
clickhouse-client– ClickHouse CLI client tool
xmllint is used to parse clickhouse’s config file, which is an
xmllint is included in
libxml package, so you may need to install it.
clickhouse-client is used to run commands with ClickHouse.
clickhouse-client packages are available for installations for
- deb-based distributions. More details and installation instructions here
- rpm-based distributions. More details and installation instructions here
ClickHouse monitoring template is available on github.
You need to obtain the template locally. You can either:
- clone it with
git clone https://github.com/Altinity/clickhouse-zabbix-template
- or download two files, one of which is a monitoring script, the other is Zabbix template XML file.
wget https://raw.githubusercontent.com/Altinity/clickhouse-zabbix-template/master/zbx_clickhouse_monitor.sh wget https://raw.githubusercontent.com/Altinity/clickhouse-zabbix-template/master/zbx_clickhouse_template.xml
Make monitoring script executable
chmod a+x zbx_clickhouse_monitor.sh
Now, having template and monitoring script locally available, we can setup Zabbix configuration.
/etc/zabbix/zabbix_agentd.confand add launch command for monitoring script. Example:
UserParameter=ch_params[*],sh /PATH/TO/zbx_clickhouse_monitor.sh "$1" "HOST_WHERE_CLICKHOUSE_IS_RUNNING"
zbx_clickhouse_monitor.shis a monitoring script, which is in charge of fetching monitoring data samples from clickhouse being monitored.
/PATH/TO/zbx_clickhouse_monitor.shdepends on where you’ve cloned template’s repo.
HOST_WHERE_CLICKHOUSE_IS_RUNNINGis an optional parameter which tells what clickhouse instance are we going to fetch data from. In case none specified
localhostwould be used.
Setup Zabbix template
Import template as following:
- Open Zabbix
zbx_clickhouse_template.xmlfile. Location depends on where you’ve cloned Zabbix template
ImportThat’s it – now ClickHouse monitoring should be availbale and new Graphs with ClickHouse data should be added.
It is easy to setup ClickHouse monitoring with Zabbix by using Altinity’s Zabbix template. Give it a try!