Source
DBadd_condition_alloc(&sql, &sql_alloc, &sql_offset, "groupid", groupids->values, groupids->values_num);
/*
** Zabbix
** Copyright (C) 2001-2022 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 enum
{
ZBX_DISCOVERY_UNSPEC = 0,
ZBX_DISCOVERY_DNS,
ZBX_DISCOVERY_IP,
ZBX_DISCOVERY_VALUE
}
zbx_dcheck_source_t;
/******************************************************************************
* *
* Function: select_discovered_host *
* *
* Purpose: select hostid of discovered host *
* *
* Parameters: dhostid - discovered host id *
* *
* Return value: hostid - existing hostid, 0 - if not found *
* *
* Author: Alexei Vladishev *
* *
******************************************************************************/
static zbx_uint64_t select_discovered_host(const DB_EVENT *event)
{
DB_RESULT result;
DB_ROW row;
zbx_uint64_t hostid = 0, proxy_hostid;
char *sql = NULL, *ip_esc;
zabbix_log(LOG_LEVEL_DEBUG, "In %s() eventid:" ZBX_FS_UI64, __func__, event->eventid);
switch (event->object)
{
case EVENT_OBJECT_DHOST:
case EVENT_OBJECT_DSERVICE: