Source
xxxxxxxxxx
static void hk_history_item_update(zbx_hk_history_rule_t *rules, int count, const zbx_hk_history_rule_t *rule_add,
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/* the maximum number of housekeeping periods to be removed per single housekeeping cycle */
/* trends table offsets in the hk_cleanup_tables[] mapping */
/* Housekeeping rule definition. */
/* A housekeeping rule describes table from which records older */
/* than history setting must be removed according to optional */
/* filter. */
typedef struct
{
/* target table name */
const char *table;
/* ID field name, required to select IDs of records that must be deleted */
char *field_name;
/* Optional filter, must be empty string if not used. Only the records matching */
/* filter are subject to housekeeping procedures. */
const char *filter;
/* The oldest record in table (with filter in effect). The min_clock value is */
/* read from the database when accessed for the first time and then during */
/* housekeeping procedures updated to the last 'cutoff' value. */
int min_clock;
/* a reference to the housekeeping configuration mode (enable) option for this table */
unsigned char *poption_mode;
/* a reference to the settings value specifying number of seconds the records must be kept */
int *phistory;
}
zbx_hk_rule_t;
/* housekeeper table => configuration data mapping */
/* This structure is used to map table names used in housekeeper table to */
/* configuration data. */
typedef struct
{
/* housekeeper table name */
const char *name;
/* a reference to housekeeping configuration enable value for this table */
unsigned char *poption_mode;
/* a reference to the housekeeping configuration overwrite option for this table */
unsigned char *poption_global;
}