Zabbix housekeeping and data retention settings: what teams need to decide first
If your Zabbix server database keeps growing, housekeeping and retention settings control how long Zabbix keeps four kinds of data: item history, trends, events and sessions. Each has its own retention period, and the housekeeper deletes records once they age past that period. Before changing any number, decide what each data type must answer. Raw history supports short-term troubleshooting and detailed graphs, trends are summarized values that support long-range capacity planning, events record problems and recoveries for incident review and audit, and sessions record web interface logins. These needs usually differ, so one retention value for everything rarely fits.
The housekeeper does not remove every old event. It deletes only events that are not tied to a problem, so a problem that is still open keeps its event record until it resolves. This protects active incidents, but it also means a long-running problem can hold records far longer than the retention period suggests. Session retention changed in Zabbix 7.4, where the default dropped from 365 to 31 days, so teams upgrading across that release should check whether their audit expectations still match. Confirm the current defaults and retention ranges in the Zabbix housekeeping documentation for your exact version.
Plan retention before the database becomes a problem, not after disk alerts start firing. Decide the retention periods during design, agree them with the people who must answer audit and capacity questions, and record which items need longer history than the global default. Also check how your environment will absorb the data: the size of the history table depends on your item count, polling intervals and data types, which you should measure in your own environment rather than assume. Changes to retention do not shrink the database immediately, so the time to test a new policy is before growth forces an emergency cleanup.
Which retention option fits which data
This table compares the Zabbix retention settings for history, trends, events, audit records and sessions, plus global overrides and external housekeeping. Read each row for what the setting keeps, what it removes and the kind of data it suits. The main takeaway is that retention is set per data type, so audit and capacity needs should be decided before the database grows.
| Retention option | What it keeps and removes | When it fits |
|---|---|---|
| History | Keeps raw collected values for the configured period, then removes older values per item. Used by graphs and detailed lookups. | Short periods for high-frequency items where detail is needed only for recent troubleshooting. Confirm the period against your storage plan. |
| Trends | Keeps hourly minimum, maximum, average and count summaries after raw history is removed. Much smaller than history. | Long periods for capacity planning and year-over-year comparison. Confirm the trend period needed for your reports. |
| Events | Removes events not tied to problems. A problem event stays while the problem is unresolved, even past the retention period. | Recording who was notified and when, for incident review. Expect unresolved problems to remain in the database. |
| Audit log | Keeps records of configuration and user actions for the configured period, then removes older entries. | Periods set by your audit and evidence requirements. Confirm the period with your compliance owner before reducing it. |
| Sessions | Keeps web login session records. The default fell from 365 to 31 days in Zabbix 7.4. | Short periods for most sites. Check the default after upgrading to 7.4 or later, since older installs may have kept a longer period. |
| Global overrides | Applies one retention value to all items or types of data at once, replacing per-item settings where enabled. | Consistent policy across many items. Review per-item settings first, because an override can shorten history you meant to keep. |
| External housekeeping | Removes data outside Zabbix with scripts or database jobs instead of the built-in housekeeper. | Large installations or data that must be archived before removal. Test restores and confirm Zabbix support for the approach. |
Trade-offs between short and long retention
Every retention value is a bet on what you will need later: evidence for an incident or audit, trend data for capacity planning, or a smaller and faster database today. The cards below cover the risks on each side, so you can set history, trend, event and session periods against your own review cycle and growth.
Losing incident evidence early
Short history retention removes the raw item values that explain a past outage, such as the exact sequence of a slow disk or a flapping link. Once the housekeeper deletes them, you cannot recover them from Zabbix. Before you shorten history, ask your incident review and audit owners how far back they open tickets, and set the period to cover that window with margin for slow investigations.
Weakening capacity trends
Trend data holds hourly summaries that capacity planning relies on, and it is usually kept far longer than raw history. Shortening trend retention flattens the view of seasonal peaks and slow growth, so planning decisions rest on less data. Check that the trend period covers at least one full business cycle for the resources you plan, such as storage or licensed capacity.
Keeping problem events open
The housekeeper removes only events that are not tied to problems, so an old problem event stays in the database while its problem is unresolved. A long-running problem can therefore hold event rows well beyond the event retention you set. Review open problems regularly, and do not assume a short event period will clear them.
Housekeeping docsDatabase growth from long history
Long history retention multiplies the rows the server writes and the space the database holds, and that growth compounds with every new item you add. Larger tables slow queries in the frontend and lengthen backup and restore windows. Before you extend history, estimate the item count and update interval your installation runs, then test the database size and backup duration in a copy of production.
Session data and the 7.4 default
Session retention controls how long user session records remain in the database. The default dropped from 365 to 31 days in Zabbix 7.4, so an upgrade can change how far back session records go without any setting change on your side. Confirm the value after upgrading, and set it to match your access review and audit needs rather than the default alone.
7.4 upgrade notesSlower queries and backups
Large tables affect more than storage. Graphs, latest data and reports scan more rows, and backup jobs copy more data on every run. Slow queries can delay the frontend during an incident, which is when operators need it most. Measure query times and backup duration after each retention change, and keep the retention period in your backup and restore plan so recovery time stays within your target.
How to set housekeeping and retention in Zabbix
This sequence turns an unmanaged Zabbix database into one with deliberate retention for each data type, so storage stays predictable while audit and capacity planning data survives.
Measure the database and list data consumers
Before changing anything, the Zabbix administrator checks how large the history, trend, event and session tables are and which teams rely on each data type, such as capacity planning, incident review or audit. Ask the security and compliance leads which records they must keep and for how long, since that answer sets the floor for retention. The step is done when you have a written table of current size per data type and a named owner with a retention requirement for each one.
Set retention per item type
In the Zabbix web interface, the administrator opens the item, trigger and event settings that control history and trend storage and sets retention values that match the requirements from the previous step. Numeric values held as history usually need a shorter period than trends, which keep summarized data for longer. Record each chosen value and the reason for it in your change log. The step is done when every item type you monitor has an explicit value rather than an inherited default.
Decide on global overrides
The administrator decides whether a single global housekeeping setting should override the per-item values, which is useful when one policy must apply everywhere. Review each override against the requirements from the first step, because a global value can shorten history that a team depends on. Document who approves overrides and under what conditions they change. The step is done when the global settings are written down with their approval and the reason for each override.
Decide whether to use external housekeeping
If the database volume or the purge workload is too large for the built-in housekeeper, the team evaluates an external housekeeping approach, such as partitioning or scheduled deletion managed outside Zabbix. Confirm the approach with the Zabbix documentation for your version and test it on a copy of the database before production use. Make sure the chosen method still keeps the records your audit requirements name. The step is done when the decision is recorded with a tested procedure, or when you document why the built-in housekeeper is sufficient.
Confirm the housekeeper is running
The administrator checks the housekeeping settings in the web interface and confirms the housekeeper is enabled, then reviews the server log for housekeeper entries after a cycle has run. Compare table sizes against the baseline from the first step to see whether they stop growing past the configured retention. Ask your Zabbix support or documentation for the exact internal items that report housekeeping activity in your version. The step is done when logs and table sizes show the housekeeper removing expired data on schedule.
Check that unresolved problem events remain
Test the retention settings for events, because the housekeeper removes only events not tied to problems. Find or create a test problem, leave it unresolved past the event retention period in a non-production environment, and confirm the problem event still appears in the interface. Then resolve it and confirm the event is eligible for removal after the retention period. The step is done when the test shows that open problems survive housekeeping and resolved events expire as configured.
Review session retention and version defaults
Check the session data retention setting, which changed its default in Zabbix 7.4, so an upgrade can shift how long session records are kept. Confirm the value against the upgrade notes for your release and set it to match your access audit requirements. Schedule a periodic review of all retention values, typically after each upgrade and when compliance requirements change. The step is done when session retention is explicitly set, the upgrade notes were checked, and the review date is recorded.
How the housekeeper decides what to delete
The diagram starts where the Zabbix server writes history, trends, events and sessions into the database. The housekeeper then checks each record against its retention setting, and the global override if one applies. Records past retention are removed, but events tied to an unresolved problem stay until the problem is resolved. Check that the retention you configured matches what your audit and capacity planning actually need.
Illustrative flow of how the housekeeper decides which records to remove.
Security and operational considerations for retention data
Retained Zabbix data is useful to auditors, capacity planners and incident responders, and it is also sensitive. The cards below cover who can read it, how backups must match the retention you set, how changes are approved, and how to keep retention decisions traceable during an audit.
Who can read retained history
Historical item values, problem events and event details can reveal host names, network layout, application behavior and sometimes sensitive values captured by custom items. Review which user groups and roles can view history, events and the audit log, and confirm that retention limits do not stand in for access control. Check whether data from restricted hosts is visible to users who should not see it, and document who holds the Super Admin role, since it can change housekeeping settings.
Backups must match retention
A backup taken before housekeeping runs contains data that the live system has already deleted, and a restore brings that data back with its original retention clock. Decide which retention period applies to the backup itself, and confirm that restored data will be pruned again on schedule after recovery. Test a restore into a non-production environment and check the database size and housekeeping behavior afterward.
Session and login records
Session data and user login records are personal data for many organizations, so their retention deserves a decision separate from metric history. Confirm the session retention value on your version, because the default changed in Zabbix 7.4, and do not assume the old default still applies after an upgrade. Record the chosen period in your data inventory so privacy and HR teams can answer retention questions.
Retention changes during audits
Shortening retention during an active audit, incident or legal hold can destroy evidence the assessor expects to see. Before changing any retention value, check whether an audit, investigation or litigation hold covers the affected data, and pause the change if it does. Record the old value, the new value, the date and the reason, so an assessor can see when and why data stopped being kept.
Approving retention changes
Treat retention settings as configuration with an owner, not as a tuning knob for whoever is watching the database size. Name the people who may approve changes, usually a monitoring owner with a security or compliance reviewer for audit-relevant data, and require a written request that states the data class and the reason. Keep the approval in your change system so it links to the configuration history.
Tracing configuration changes
Global housekeeping changes and per-item overrides both affect what is kept, and a per-item override can quietly keep or drop data that the global setting does not describe. Export the current housekeeping settings and the list of items with custom history or trend periods on a schedule, and compare exports over time. Review the Zabbix audit log for changes to these settings and confirm that log is itself retained long enough for your review cycle.
When external housekeeping makes sense and what it risks
When should a team delete Zabbix data outside the housekeeper?
Teams usually consider external removal when the built-in settings cannot deliver the retention they need, or when the database grows faster than housekeeping can manage. Common triggers include retention requirements that differ by data type, a backlog of old records after housekeeping was disabled for a long period, or a need to archive data before it is removed. Before choosing this path, confirm that the housekeeping settings, including global overrides, truly cannot meet the requirement. External removal changes the Zabbix database directly, so it should be backed by a documented gap in retention.
Why does deleting old Zabbix records directly cause problems?
Zabbix stores monitoring data in linked records, so deleting rows by age can leave references that point to nothing. The housekeeper is built to handle these links. For example, it removes only events that are not tied to problems, so an old event that backs an unresolved problem stays in place. A delete that ignores these relationships can break problem history, cause errors in the web interface, or leave orphaned data for the server and frontend to cope with. The safest rule is that any removal must respect the records Zabbix still references.
Should we test external housekeeping on a copy first?
Yes. Run any external removal first against a restored copy of the production database, using the same Zabbix version, and check the results in the web interface before anything touches production. Compare record counts, open problems, event history for a sample of triggers, and dashboards that depend on older data. Confirm that the Zabbix server and frontend start cleanly and that the housekeeper still runs afterward. Keep backup and restore steps tested so a bad removal can be reversed, and record what was removed and why, because auditors and capacity planners will ask later.
Does a Zabbix upgrade change how long data is kept?
Yes, defaults can change between versions. In Zabbix 7.4 the default session data retention dropped from 365 days to 31 days, so an upgrade can change what is kept without anyone editing settings. Teams that rely on defaults should check session retention and the other housekeeping values after upgrading, then compare them with their audit needs. The change is described in the Zabbix 7.4.0 upgrade notes. A team that upgrades without reading those notes may find that session records disappear sooner than it expected.
What does external housekeeping cost, and who pays?
Cost depends mostly on the work, because Zabbix open source has no license fee. The main costs are staff or partner time to define the retention requirement, build and test the removal process, document it, and keep it working through upgrades. Recurring costs include reviewing the process at each Zabbix release and monitoring the removal job itself. Storage savings offset some of this, but their size depends on your data volume, which you should measure before deciding. When requesting a quote, ask for a written scope that covers testing on a copy, rollback, documentation and upgrade checks.
Can our own team run external housekeeping, or do we need a partner?
A team with experienced database administrators and Zabbix operators can handle it, provided it has a tested backup and restore path and a clear retention policy. A partner is useful when the team lacks database depth, when the requirement covers compliance evidence that must be preserved, or when the removal must be proven on a copy before a production change window. DeployOpen works on fixed-scope engagements agreed in writing, so testing, rollback and documentation are defined before work starts. Either way, ask for a demonstrated test restore first.
What should we ask for before approving a removal job?
Ask for evidence on these points before approving any external removal:
- A written retention requirement for each data type, linked to audit and capacity needs.
- Proof that the removal ran on a restored copy at the same Zabbix version, with the results compared.
- Confirmation that open problems and the events tied to them are excluded from the removal.
- A rollback plan with a backup that has been restored successfully.
- A check of housekeeping settings after every Zabbix upgrade, with a record of the outcome.
Limits and what to confirm in your environment
Retention settings interact with the Zabbix version, the database engine and your own compliance policy, so the same numbers can behave differently across installations. The cards below list what to confirm before you change retention, and where the official documentation answers each question.
Exact Zabbix version and defaults
Housekeeping defaults have changed between releases, and the session retention default changed in Zabbix 7.4. Record the exact server version and read the housekeeping defaults for that version, rather than relying on values from an older install guide or a neighbouring environment. Compare them with the values currently stored in the administration settings, because an upgrade may keep an earlier value that you have never reviewed.
- Session default in 7.4
- 31 days
Problem events kept while open
The housekeeper removes only events that are not tied to problems. An old event stays in the database while its problem is unresolved, so a long-running problem can keep event rows well past the configured event retention. Confirm how many problems are open for long periods in your environment before you assume the retention setting controls the size of the event table.
Housekeeping docsOverrides for each item type
Global housekeeping settings can be overridden at the level of individual items and trends, and the override rules differ by item type and by how the item stores its data. Export the item list with its history and trend settings, then test one representative item of each type to confirm the retained period matches your plan. Keep a record of every override so a later change does not silently shorten data you need.
Database deletion behavior
How the housekeeper deletes rows depends on your database engine and on whether partitioning or TimescaleDB compression is in use. Large delete batches can lock tables and slow the server, and some engines reclaim disk space only after maintenance. Ask your DBA how the chosen engine frees space after deletion, and test the housekeeping window on a copy of the production database before you enable a larger reduction.
Zabbix requirementsCompliance retention periods
Retention periods for audit logs, access records and monitoring evidence usually come from your own policy, contracts or regulators rather than from Zabbix defaults. Map each data type Zabbix stores to a named owner and a required retention period, including audit data and session records. Have your compliance lead approve the mapping before you reduce any setting that feeds an audit trail.
Capacity planning data needs
Trend data supports long-range capacity reports, while raw history is usually needed only for recent troubleshooting. Decide how many months of trends your capacity plans need and whether the capacity team can accept averaged data after raw history expires. Check that reports and dashboards you rely on still return results after the proposed retention is applied.
Questions buyers ask about Zabbix retention
Can our in-house team set Zabbix housekeeping and retention up without a partner?
Yes, many teams can, because the core settings are visible in the web interface and the work is mostly deciding what to keep and for how long. The harder part is confirming that the decisions match your audit and capacity planning needs, and that the database is sized and backed up before retention is reduced. Check whether your team has someone who already administers the Zabbix database and understands the housekeeper, and whether anyone owns the retention policy. If those roles are thin, a fixed-scope engagement can put the policy, settings and verification in writing before changes reach production.
What drives the cost of a Zabbix retention project?
The main drivers are the number of hosts and items, how much history and trend data you already hold, how many retention rules you need (by item type, host group or application), what audit and evidence periods you must keep, and which database platform you run. Cost is mostly the time to inventory data, agree retention with your compliance and capacity owners, apply and test changes, and document them. One-time work includes the policy and initial configuration. Recurring work is periodic review as the monitored estate grows. Ask any provider for a quote that lists these items separately.
How long does a housekeeping and retention project usually take?
The duration depends on the drivers above more than on any standard figure, and no fixed timeline applies to every environment. A small installation with a clear retention policy moves much faster than a large one where audit periods are disputed or where history must be reduced in stages on a big database. Ask for a schedule in the written scope with milestones for policy sign-off, staging tests, production change and post-change checks. Include time for at least one full housekeeping cycle to run before you judge the result.
What do we need to provide before retention work starts?
You need to provide access to the Zabbix frontend with an administrator role, read access to the database or its statistics, a staging copy to test changes, and a list of the audit, incident and capacity-planning periods your organization must retain. You also need the owners who will approve the policy, usually security, compliance and the platform team. Confirm backup status and a tested restore path before any retention reduction, since deleted history cannot be recovered from Zabbix itself.
Why do old problem events still show in Zabbix after housekeeping runs?
The housekeeper removes only events that are not tied to problems, so an old problem event stays while its problem is unresolved. This protects open incidents but means a long-running problem can keep event records alive well past your retention period. Review open problems as part of retention planning, and confirm how your team closes stale problems so the event data can age out as intended. The official housekeeping documentation describes these rules and is the right reference to check against your version.
What changed for session retention in Zabbix 7.4?
The default session data retention dropped from 365 days to 31 days in Zabbix 7.4. If you upgraded from an earlier release and kept the previous behavior, you may see a different session history than you expected, which matters if session records are part of your access evidence. Check the 7.4.0 upgrade notes and decide whether 31 days meets your audit needs or whether you need a longer period set explicitly and exported elsewhere.
How should we handle a Zabbix database that is already very large?
Start by measuring what is in the database and which item types and periods drive its size, then agree the retention you actually need before changing anything. Reduce retention in controlled steps on a staging copy first, and confirm that the housekeeper keeps up without locking the database for long periods. Take and test a backup before the change. If the database is too large to manage with housekeeping alone, consider whether other options, such as TimescaleDB compression, fit your platform, and confirm its license terms and limits before you turn it on. Ask for a written plan that covers measurement, staged change, rollback and post-change verification.
How DeployOpen scopes and supports Zabbix retention work
DeployOpen plans and implements Zabbix retention in your own infrastructure, starting from the audit, capacity and troubleshooting questions your team must answer. Each engagement is fixed-scope, with the retention policy, overrides and handover agreed in writing before work starts.
How we scope
- We inventory which item types feed history, trends, events and sessions, and who needs each kept and for how long.
- The written scope names the retention periods, global overrides and any external housekeeping jobs to be configured.
- Scope also lists database size targets, backup timing and the capacity checks to run before and after the change.
How we build
- We apply retention settings in a non-production copy first and measure database growth and housekeeper runtime.
- We confirm that problem events are kept while unresolved, so open incidents remain visible during investigations.
- We test restores from backups taken with the new retention settings to confirm audit-relevant history is still recoverable.
How we hand over
- We document each retention value, its owner, the reason for it and the change procedure for future adjustments.
- We provide a runbook covering housekeeper checks, expected table growth and what to review after each Zabbix upgrade.
- We walk your operations and compliance staff through the evidence showing retention matches the agreed policy.
How we support
- Ongoing support, upgrades and continuous checks of database size and housekeeper health are available as a retainer.
- Retention defaults can change between Zabbix versions, so we review settings as part of each planned upgrade.
- Ask any provider to confirm which retention values, storage limits and recovery targets they will own after go-live.

