Skip to content

Postgresql partitioning on zabbix monitoring server

Daniel Kontšek edited this page Aug 3, 2017 · 2 revisions

How to enable DB partitioning and disable Housekeeper on Zabbix monitoring server

WARNING: PostgreSQL partitioning of the Zabbix database is not supported by Zabbix SIA support or by Erigones (Danube Cloud) support. Use at your own risk!

Zabbix partitioning helper SQL functions and scripts are available on the esdc-mon VM image version 2.6.1 or later. The scripts are based on https://github.com/cavaliercoder/zabbix-pgsql-partitioning and can be found here: https://github.com/erigones/esdc-factory/tree/master/ansible/roles/zabbix-server-partitioning

  1. Connect to the Zabbix server and stop the zabbix-server service:

    [root@mon01 ~]# systemctl stop zabbix-server
  2. Check the /usr/local/sbin/zbx_partitions.py script for suitable partitioning schema (tables dict):

    vim /usr/local/sbin/zbx_partitions.py
  3. Create DB partitions (these may take a long time if you have lots of data):

    /usr/local/sbin/zbx_partitions.py init -v
  4. Disable Housekeeper by editing the /etc/zabbix/zabbix_server.conf file:

    HousekeepingFrequency=0
  5. Start the Zabbix server:

    [root@mon01 ~]# systemctl start zabbix-server
  6. Enable automatic creation of new and deletion of old partitions:

    [root@mon01 ~]# crontab -e
    
    30 1 * * * /usr/local/sbin/zbx_partitions.py

Don't forget to monitor the correct functioning of the regular zbx_partitions.py script.

Clone this wiki locally