ch14: add Housekeeping and the events tables chapter - #402
Open
WMP wants to merge 1 commit into
Open
Conversation
…ge, monitoring) New expert-level page covering what the four-five event sources are, the events/event_tag/event_recovery/problem tables and their cascade relationship, how the housekeeper deletes events per source and how to spot it falling behind, why a bloated events table slows the Problems page and history widgets, a low-cost SQL check to monitor table sizes from Zabbix, a safe batched procedure to purge internal events, reclaiming disk afterwards (pg_repack, autovacuum_work_mem), and the upstream fixes (LLD filters, Check for not supported, trigger dependencies not writing event rows vs maintenance which does). Added to nav. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Hi @WMP Thank you for contributing, we appreciate it. The parts look promising, but are missing some images. Could you add some screenshots to make it more visible to the reader what you are doing in Zabbix to make your parts work? Furthermore, if you'd like these parts to be merged into the book we are going to need a signing deed of transfer. Can I send the file to the email address listed on your public profile? Kind regards, Nathan |
Author
|
Regarding the screenshots - I’ll see what I can do; I can upload some screenshots from Postgres and screenshots of the check creation process. Yes, you can send an email - but watch out for a small typo in the domain address; it’s a special security measure against bots. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new expert-level page "Housekeeping and the events tables" to
Chapter 14 (
ch14-zabbix-maintenance/housekeeper-events-tables.md) and wires itinto the navigation.
The existing Internal health page covers the housekeeper at a high level
(deleted-object cleanup). This page goes deep on the
events/event_tagtablesthemselves — what fills them, how they are cleaned, how to monitor them, and what
to do when the housekeeper can no longer keep up. None of
event_tag,pg_repack,maintenance_work_mem,CHECK_NOT_SUPPORTEDor the per-sourceevent breakdown currently appear anywhere in the book.
What it adds
sourcevalues (trigger / network discovery /autoregistration / internal / service) and the
objectrefinement; whichsource tends to explode (internal) and why.
events,event_tag(usually the largest table),event_recovery,problem/problem_tag, and theON DELETE CASCADErelationship (plus the non-cascading
cause_eventid).Administration → Housekeeping,
HousekeepingFrequency,MaxHousekeeperDelete, and how to read the server log to see it fall behind.history/Item value widgets, and keeps autovacuum busy.
Zabbix itself, using catalog sizes and planner estimates (
reltuples,pg_statsMCV) instead of expensivecount(*)scans, wired via the agent 2PostgreSQL plugin.
beyond the housekeeper (LIMIT + commit per batch, clear
cause_eventidfirst,let the cascade remove children, watch replication).
pg_repackvsVACUUM FULL, raisingautovacuum_work_memto avoid repeated index passes, and the cosmetic"oldest XID" alert from a long-running vacuum.
Check for not supported value, cross-linked to Chapter 4) and the fact that
trigger dependencies do not write an event row at all, unlike maintenance
suppression which still writes the event and merely hides it.
Why
Large environments routinely hit events-table bloat after a single template
starts generating internal events at scale. The symptoms (slow Problems page,
history widgets timing out, autovacuum/OOM) are rarely connected back to the
events tables. This page gives operators the model, the monitoring, and the
remediation in one place.
Notes
mkdocs.yml. Style follows book conventions(meta description +
tags: [expert], admonitions, ~80-column prose).concepts (event types, housekeeping, dependencies) are database-agnostic.
Sources
https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/housekeeping
https://www.zabbix.com/documentation/current/en/manual/config/events/sources
HousekeepingFrequency,MaxHousekeeperDelete):https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_server
https://www.zabbix.com/documentation/current/en/manual/config/triggers/dependencies
(
src/zabbix_server/events/events.c,event_check_dependency/save_events):https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/zabbix_server/events
https://www.postgresql.org/docs/current/routine-vacuuming.html
pg_stats/ planner statistics used for estimates:https://www.postgresql.org/docs/current/view-pg-stats.html
https://www.postgresql.org/docs/current/progress-reporting.html
pg_repack— online table/index rebuild:https://reorg.github.io/pg_repack/
(~1 TB DB, hundreds of millions of internal events purged in batches).