Source
*replace_to = zbx_strdcatf(*replace_to, "%sHost: \"%s\" Problem name: \"%s\" Severity: \"%s\" Age: %s"
/*
** 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.
**/
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 *
* *
******************************************************************************/
void zbx_eventdata_to_str(const zbx_vector_eventdata_t *eventdata, char **replace_to)
{