管家(housekeeper)是一个周期性进程,由Zabbix server执行。 此进程将清理过时的信息和已被用户删除的信息。
在本节中,可以针对以下项目分别启用或禁用管家任务: 事件和告警/IT 服务/用户会话/历史数据/趋势数据 , 审计日志的管家设置在独立的 菜单 中进行。
如果启用了管家程序,则可以设置数据条目在被管家程序删除之前将保留多少天。
删除监控项/触发器时,也会删除由该监控项/触发器生成的问题。
此外,只有当事件与问题无关时,管家程序才会删除该事件。 这意味着,如果某个事件是问题事件或恢复事件,则在删除相关问题条目之前不会删除该事件。 管家程序将首先删除问题,然后删除事件,以避免过时事件或问题条目的潜在问题。
对于历史数据和趋势数据,可以使用其他选项: 覆盖监控项历史数据周期 和 覆盖监控项趋势数据周期。 此选项允许全局设置监控项历史数据/趋势数据的存储天数(1 小时到 25 年; 或"0"), 将覆盖监控项配置表单中为单个监控项配置的 存储期限 值。 请注意,对于启用了 不存储 选项的监控项,存储期限不会被覆盖。
即使禁用了内部管家,也可以覆盖历史数据/趋势数据存储期限。 因此,当使用外部管家时,可以使用历史数据的 数据存储期限 字段设置历史数据保留时长。
如果使用 TimescaleDB, 为了充分利用 TimescaleDB 对历史表和趋势表的自动分区, 必须启用 覆盖监控项历史数据期限 和 覆盖监控项趋势数据期限 选项 以及历史数据和趋势数据的 启用内部管家 选项 否则,保存在这些表中的数据仍将存储在分区中。 但是,管家不会丢弃过时的分区, 并且会显示有关配置不正确的警告。 启用删除过时分区后, Zabbix server和前端将不再跟踪已删除的监控项, 并且在删除过时的分区时,同时清除已删除监控项的历史数据。
期限字段支持时间单位 , 例如, 1d (1天), 1w (1星期)。 最短为 1 天(历史数据为 1 小时),最长为 25 年。
重置为默认 按钮允许还原所做的任何更改。
The table below describes housekeeping configuration parameters.
Parameter | Description |
---|---|
Enable internal housekeeping | Enable (default) or disable internal housekeeping for this group of entities. |
Data storage period | Amount of time records should be kept before being removed by the housekeeper. Mandatory if housekeeping is enabled. Range: 1 day (1 hour for history) - 25 years; or "0". Time suffixes are supported, e.g., 1d (one day), 1w (one week). For Events and alerts data storage period is set separately for triggers, services, internal data, network discovery, and autoregistration. For items, data storage period also determines the period for which the data will be visible in the Monitoring > Latest data section, even if internal housekeeping is disabled. |
Override item history period | If checked, history/trend storage period specified in the item configuration will be overridden by the global setting. The storage period will not be overridden for items that have configuration option Do not store enabled. It is possible to override the history/trend storage period even if internal housekeeping is disabled. Thus, when using an external housekeeper, the history storage period could be set using the history Data storage period field. |
Override item trend period |
The Reset defaults button allows reverting any changes made.
- Deleting an item/trigger will also delete problems generated by that item/trigger.
- Problem or recovery events will not be deleted until their related problem record is deleted. The housekeeper first deletes problems, then events, to prevent stale data.
If using TimescaleDB, in order to take full advantage of TimescaleDB automatic partitioning of history and trends tables, Override item history period and Override item trend period options must be enabled as well as Enable internal housekeeping option for history and trends. Otherwise, data kept in these tables will still be stored in partitions, however, the housekeeper will not drop outdated partitions, and warnings about incorrect configuration will be displayed. When dropping of outdated partitions is enabled, Zabbix server and frontend will no longer keep track of deleted items, and history for deleted items will be cleared when an outdated partition is deleted.