Source
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern unsigned char process_type, program_type;
extern int server_num, process_num;
static int hk_period;
/* the maximum number of housekeeping periods to be removed per single housekeeping cycle */
/* global configuration data containing housekeeping configuration */
static zbx_config_t cfg;
/* 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 */