ClickHouse monitoring with Zabbix
Sept 4, 2018
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:
Zabbix
monitoring 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
git
asgit 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.
Make monitoring script executablewget 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
Now, having template and monitoring script locally available, we can setup Zabbix configuration.chmod a+x zbx_clickhouse_monitor.sh
- Edit
/etc/zabbix/zabbix_agentd.conf
and add launch command for monitoring script. Example:
Where:UserParameter=ch_params[*],sh /PATH/TO/zbx_clickhouse_monitor.sh "$1" "HOST_WHERE_CLICKHOUSE_IS_RUNNING"
zbx_clickhouse_monitor.sh
is a monitoring script, which is in charge of fetching monitoring data samples from clickhouse being monitored./PATH/TO/zbx_clickhouse_monitor.sh
depends on where you've cloned template's repo.HOST_WHERE_CLICKHOUSE_IS_RUNNING
is an optional parameter which tells what clickhouse instance are we going to fetch data from. In case none specifiedlocalhost
would be used.
Setup Zabbix template
Import template as following:
- Open Zabbix
- Select
Configuration

- Select
Templates

- Click
Import Template

- Choose
zbx_clickhouse_template.xml
file. Location depends on where you've cloned Zabbix template


- Click
Import
That'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!
Feb 14, 2019
In our previous articles we demonstrated that ClickHouse -- a general purpose analytics DB -- can easily compete with specialized DBMSs for time series data: TimescaleDB and InfluxDB. There were, however, certain queries, pretty typical for time series, where ClickHouse seemed at first glance to be at a disadvantage. The most notable example is returning the latest measurement for particular device. We will take this query and demonstrate how ClickHouse advanced features, namely materialized views and self-aggregating tables, can dramatically improve performance.