All Projects → zabbix-tools → zabbix-pgsql-partitioning

zabbix-tools / zabbix-pgsql-partitioning

Licence: other
Partitioning scripts for Zabbix on PostgreSQL

Programming Languages

PLpgSQL
1095 projects

Projects that are alternatives of or similar to zabbix-pgsql-partitioning

Zabbix
Zabbix Plugin
Stars: ✭ 195 (+650%)
Mutual labels:  zabbix
zbxdb
Zabbix database monitoring, the easy and extendable way
Stars: ✭ 87 (+234.62%)
Mutual labels:  zabbix
pyspark-algorithms
PySpark Algorithms Book: https://www.amazon.com/dp/B07X4B2218/ref=sr_1_2
Stars: ✭ 72 (+176.92%)
Mutual labels:  partitioning
Zbx Smartctl
Templates and scripts for monitoring disks health with Zabbix and smartmontools
Stars: ✭ 206 (+692.31%)
Mutual labels:  zabbix
Golang Stats Api Handler
Golang cpu, memory, gc, etc information api handler.
Stars: ✭ 247 (+850%)
Mutual labels:  zabbix
ESP32Partitions
No description or website provided.
Stars: ✭ 30 (+15.38%)
Mutual labels:  partitioning
Wgcloud
linux运维监控工具,支持系统信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,API接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,linux面板,探针,故障告警
Stars: ✭ 2,669 (+10165.38%)
Mutual labels:  zabbix
clean-architecture-azure-cosmos-db
A starting point to build a web API to work with Azure Cosmos DB using .NET 5 and Azure Cosmos DB .NET SDK V3, based on Clean Architecture and repository design pattern. Partition key is also implemented through the repository pattern.
Stars: ✭ 277 (+965.38%)
Mutual labels:  partitioning
MahjongKit
Riichi Mahjong Kit: (1) Game log crawler (sqlite3, json, bs4); (2) Game log preprocessor; (3) Deterministic algorithms library
Stars: ✭ 39 (+50%)
Mutual labels:  partitioning
docker-alpine
Docker Alpine Linux Base Images
Stars: ✭ 27 (+3.85%)
Mutual labels:  zabbix
Ewp oms
自动化运维系统(saltstack+django+bootstrap),QQ群342844540,博客http://ywzhou.blog.51cto.com
Stars: ✭ 211 (+711.54%)
Mutual labels:  zabbix
Kubernetes Zabbix
📦 Kubernetes Zabbix/Grafana cluster (bare metal, Google Computer Engine - GCE, Google Container Engine - GKE)
Stars: ✭ 244 (+838.46%)
Mutual labels:  zabbix
zabbix-mini-IPMI
Disk and CPU temperature monitoring for Linux, FreeBSD and Windows. LLD, trapper.
Stars: ✭ 82 (+215.38%)
Mutual labels:  zabbix
Django Oms
加强版运维系统,集成工单、发布、监控、管理dns、saltstack
Stars: ✭ 201 (+673.08%)
Mutual labels:  zabbix
Email-Graph-ZABBIX Python
No description or website provided.
Stars: ✭ 16 (-38.46%)
Mutual labels:  zabbix
Zabbix manager
🍀 (1)安装后一键设置 (2)日常管理工具 (3)一键导出常用报表 (4)Zabbix API 二次开发
Stars: ✭ 192 (+638.46%)
Mutual labels:  zabbix
zabbix-cachet
Python script which sync Zabbix IT Services with Cachet
Stars: ✭ 78 (+200%)
Mutual labels:  zabbix
helm-zabbix
Helm Chart For Zabbix
Stars: ✭ 56 (+115.38%)
Mutual labels:  zabbix
zapish
zapish - Zabbix API SHell binding
Stars: ✭ 28 (+7.69%)
Mutual labels:  zabbix
zabbix-module-python
Embedded Python interpreter module for Zabbix
Stars: ✭ 32 (+23.08%)
Mutual labels:  zabbix

Zabbix PostgreSQL scripts

Scripts for partitioning the Zabbix database on PostgreSQL.

WARNINGS:

  • PostgreSQL partitioning is not supported by Zabbix SIA technical support
  • Changing partition configuration on existing datasets requires a great deal of care and is not recommended for newbies
  • The Zabbix server and web server should not be running when making changes

These scripts cater for partitioning any Zabbix tables that include the clock column.

Partitioning is recommended for large tables such as history*, trends* and events where the data size might exceed total physical RAM. When selecting a partitioning interval, try find a balance between minimising the number of partitions (e.g. use yearly or monthly), preventing empty partitions and preventing partition size from exceeding total physical RAM.

Please read all code and comments in the scripts before running on a production dataset.

Repair c_event_recovery_1 on Zabbix 3.2+

The following is only valid if your events table is partitioned prior to upgrading to Zabbix v3.2+.

See ZBX-11257.

  • Stop the Zabbix server when you see the following log entry:

    query failed: [0] PGRES_FATAL_ERROR:ERROR:  insert or update on table "event_recovery" violates foreign key constraint "c_event_recovery_1"
    
  • Run the repair script:

    $ psql -U zabbix -d zabbix < repair-zabbix-3.2.0.sql
    
  • Restart Zabbix server to resume database upgrade

  • Email author gratitude or grudge

Create partition schema

Partitioning results in a large number of tables - ever increasing over time. To simplify management, these tables should be isolated from standard Zabbix tables using a separate schema. By default, tables will be stored in the public schema. The scripts in this repo assume all partition tables will be stored instead in a schema named partitions, though this can be configured using the schema_name parameter of most script functions.

Create the schema with the following SQL query:

-- replace 'zabbix' with the name of your zabbix database role
CREATE SCHEMA partitions AUTHORIZATION zabbix;

Install partitioning functions

$ psql -U zabbix -d zabbix < bootstrap.sql

Partition a table

-- configure history table for partitioning and provision 14 days of
-- partitions
SELECT zbx_provision_partitions('history', 'day', 14);

Unpartition a table

-- remove partition configuration, migrate data into parent table and
-- drop child partitions for 'history' table
SELECT zbx_deprovision_partitions('history');

Optimize superceded partition

-- add constraint to old 'events' partition by min and max 'eventid'
SELECT zbx_constrain_partition('events_2015', 'eventid');

Drop old partitions

-- drop history partitions older than Jan 1, 2015
SELECT zbx_drop_old_partitions('history', '2015-01-01'::TIMESTAMP);

License

Copyright (c) 2016 Ryan Armstrong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].