Source
static int process_event_update(const zbx_db_trigger *trigger, char **sql, size_t *sql_alloc, size_t *sql_offset)
/*
** 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/>.
**/
/******************************************************************************
* *
* Purpose: gets total number of triggers on system *
* *
******************************************************************************/
static int get_trigger_count(void)
{
zbx_db_result_t result;
zbx_db_row_t row;
int triggers_num;
result = zbx_db_select("select count(*) from triggers");
if (NULL != (row = zbx_db_fetch(result)))
triggers_num = atoi(row[0]);
else
triggers_num = 0;
zbx_db_free_result(result);
return triggers_num;
}
/******************************************************************************
* *
* Purpose: checks if this is historical macro that cannot be expanded for *
* bulk event name update *
* *
* Parameters: macro - [IN] *
* *
* Return value: ZBX_HIST_MACRO_* defines *
* *