ClickHouse® monitoring with Zabbix

Intro
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.
Prerequisites
The following tools are required to be installed before we can start:
Zabbixmonitoring platform. More details are available herexmllist– command line XML toolclickhouse-client– ClickHouse CLI client tool
xmllint is used to parse clickhouse’s config file, which is an XML. 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
Getting started
ClickHouse monitoring template is available on github.
Setup monitoring
You need to obtain the template locally. You can either:
- clone it with
gitasgit 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.xmlMake monitoring script executable
chmod a+x zbx_clickhouse_monitor.shNow, having template and monitoring script locally available, we can setup Zabbix configuration.
- Edit
/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"Where:
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 specifiedlocalhostwould be used.
Setup Zabbix template
Import template as following:
- Open Zabbix
- Select
Configuration

- Select
Templates

- Click
Import Template

- Choose
zbx_clickhouse_template.xmlfile. Location depends on where you’ve cloned Zabbix template


- Click
ImportThat’s it – now ClickHouse monitoring should be availbale and new Graphs with ClickHouse data should be added.
Graphs available






Conclusion
It is easy to setup ClickHouse monitoring with Zabbix by using Altinity’s Zabbix template. Give it a try!
Links
ClickHouse® is a registered trademark of ClickHouse, Inc.; Altinity is not affiliated with or associated with ClickHouse, Inc.
Click Import That’s it – now ClickHouse monitoring should be availbale and new Graphs with ClickHouse data should be added.Where can I find the file???