Source
zbx_db_add_condition_alloc(&sql, &sql_alloc, &sql_offset, "groupid", groupids->values, groupids->values_num);
/*
** 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/>.
**/
typedef enum
{
ZBX_DISCOVERY_UNSPEC = 0,
ZBX_DISCOVERY_DNS,
ZBX_DISCOVERY_IP,
ZBX_DISCOVERY_VALUE
}
zbx_dcheck_source_t;
typedef enum
{
ZBX_OP_HOST_TAGS_ADD,
ZBX_OP_HOST_TAGS_DEL
}
zbx_host_tag_op_t;
/******************************************************************************
* *
* Purpose: selects hostid of discovered host *
* *
* Parameters: event - [IN] source event data *
* hostname - [OUT] hostname where event occurred *
* *
* Return value: hostid - existing hostid, *
* 0 - if not found *
* *
******************************************************************************/
static zbx_uint64_t select_discovered_host(const zbx_db_event *event, char **hostname)
{
zbx_db_result_t result;
zbx_db_row_t row;
zbx_uint64_t hostid = 0, proxyid;
char *sql = NULL, *ip_esc;