Source
xxxxxxxxxx
result = zbx_db_select("select a.clock,a.alerttype,a.status,mt.name,a.sendto,a.error,a.esc_step,a.userid,a.message"
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
typedef struct
{
char *host;
char *severity;
char *tags;
char *name;
int clock;
int nseverity;
}
zbx_eventdata_t;
ZBX_VECTOR_DECL(eventdata, zbx_eventdata_t)
ZBX_VECTOR_IMPL(eventdata, zbx_eventdata_t)
/* The following definitions are used to identify the request field */
/* for various value getters grouped by their scope: */
/* DBget_item_value(), get_interface_value() */
/* DBget_history_log_value() */
static int substitute_simple_macros_impl(const zbx_uint64_t *actionid, const zbx_db_event *event,
const zbx_db_event *r_event, const zbx_uint64_t *userid, const zbx_uint64_t *hostid,
const DC_HOST *dc_host, const DC_ITEM *dc_item, const zbx_db_alert *alert, const zbx_db_acknowledge *ack,
const zbx_service_alarm_t *service_alarm, const zbx_db_service *service, const char *tz,
zbx_history_recv_item_t *history_data_item, char **data, int macro_type, char *error, int maxerrlen);
static int substitute_key_macros_impl(char **data, zbx_uint64_t *hostid, DC_ITEM *dc_item,
const struct zbx_json_parse *jp_row, const zbx_vector_ptr_t *lld_macro_paths, int macro_type,
char *error, size_t maxerrlen);
/******************************************************************************
* *
* Purpose: get trigger severity name *
* *
* Parameters: trigger - [IN] a trigger data with priority field; *
* TRIGGER_SEVERITY_* *
* replace_to - [OUT] pointer to a buffer that will receive *
* a null-terminated trigger severity string *
* *