Source
static int db_update_event_suppress_data(int *suppressed_num, int process_num, zbx_get_config_forks_f get_forks_cb)
/*
** 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/>.
**/
/* addition data for event maintenance calculations to pair with zbx_event_suppress_query_t */
typedef struct
{
zbx_uint64_t eventid;
zbx_vector_uint64_pair_t maintenances;
}
zbx_event_suppress_data_t;
/******************************************************************************
* *
* Purpose: logs host maintenance changes *
* *
******************************************************************************/
static void log_host_maintenance_update(const zbx_host_maintenance_diff_t* diff)
{
char *msg = NULL;
size_t msg_alloc = 0, msg_offset = 0;
int maintenance_off = 0;
if (0 != (diff->flags & ZBX_FLAG_HOST_MAINTENANCE_UPDATE_MAINTENANCE_STATUS))
{
if (HOST_MAINTENANCE_STATUS_ON == diff->maintenance_status)
{
zbx_snprintf_alloc(&msg, &msg_alloc, &msg_offset, "putting host (" ZBX_FS_UI64 ") into",
diff->hostid);
}
else
{
maintenance_off = 1;
zbx_snprintf_alloc(&msg, &msg_alloc, &msg_offset, "taking host (" ZBX_FS_UI64 ") out of",
diff->hostid);
}
}