Source
zbx_db_insert_prepare(&db_insert, "proxy_dhistory", "id", "clock", "druleid", "ip", "port", "value", "status",
/*
** 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.
**/
static zbx_history_table_t dht = {
"proxy_dhistory", "dhistory_lastid",
{
{"clock", ZBX_PROTO_TAG_CLOCK, ZBX_JSON_TYPE_INT, NULL},
{"druleid", ZBX_PROTO_TAG_DRULE, ZBX_JSON_TYPE_INT, NULL},
{"dcheckid", ZBX_PROTO_TAG_DCHECK, ZBX_JSON_TYPE_INT, NULL},
{"ip", ZBX_PROTO_TAG_IP, ZBX_JSON_TYPE_STRING, NULL},
{"dns", ZBX_PROTO_TAG_DNS, ZBX_JSON_TYPE_STRING, NULL},
{"port", ZBX_PROTO_TAG_PORT, ZBX_JSON_TYPE_INT, "0"},
{"value", ZBX_PROTO_TAG_VALUE, ZBX_JSON_TYPE_STRING, ""},
{"status", ZBX_PROTO_TAG_STATUS, ZBX_JSON_TYPE_INT, "0"},
{NULL}
}
};
static void pb_discovery_add_rows_db(zbx_list_t *rows, zbx_list_item_t *next, zbx_uint64_t *lastid);
struct zbx_pb_discovery_data
{
zbx_pb_state_t state;
zbx_list_t rows;
int rows_num;
zbx_db_insert_t db_insert;
zbx_uint64_t handleid;
};
void pb_list_free_discovery(zbx_list_t *list, zbx_pb_discovery_t *row)
{
if (NULL != row->ip)
list->mem_free_func(row->ip);
if (NULL != row->dns)
list->mem_free_func(row->dns);
if (NULL != row->value)
list->mem_free_func(row->value);
list->mem_free_func(row);
}
/******************************************************************************