Source
*replace_to = zbx_strdcatf(*replace_to, "%sHost: \"%s\" Problem name: \"%s\" Severity: \"%s\" Age: %s"
/*
** 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/>.
**/
ZBX_VECTOR_IMPL(eventdata, zbx_eventdata_t)
/******************************************************************************
* *
* Purpose: free memory allocated for temporary event data *
* *
******************************************************************************/
void zbx_eventdata_free(zbx_eventdata_t *eventdata)
{
zbx_free(eventdata->host);
zbx_free(eventdata->severity);
zbx_free(eventdata->tags);
}
/******************************************************************************
* *
* Purpose: compare events to sort by highest severity and host name *
* *
******************************************************************************/
int zbx_eventdata_compare(const zbx_eventdata_t *d1, const zbx_eventdata_t *d2)
{
ZBX_RETURN_IF_NOT_EQUAL(d2->nseverity, d1->nseverity);
return strcmp(d1->host, d2->host);
}
/******************************************************************************
* *
* Purpose: build string from event data *
* *
******************************************************************************/
int zbx_eventdata_to_str(const zbx_vector_eventdata_t *eventdata, char **replace_to)
{
int i;
const char *d = "";
if (0 == eventdata->values_num)
return FAIL;