Source
zbx_uint32_t zbx_discovery_pack_usage_stats(unsigned char **data, const zbx_vector_dbl_t *usage, int count)
/*
** 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.
**/
typedef struct
{
zbx_uint64_t dserviceid;
int status;
int lastup;
int lastdown;
char *value;
}
DB_DSERVICE;
static int discoverer_initialized = 0;
void zbx_discoverer_init(void)
{
discoverer_initialized = DISCOVERER_INITIALIZED_YES;
}
/******************************************************************************
* *
* Purpose: free discovery check *
* *
******************************************************************************/
void zbx_discovery_dcheck_free(zbx_dc_dcheck_t *dcheck)
{
zbx_free(dcheck->key_);
zbx_free(dcheck->ports);
if (SVC_SNMPv1 == dcheck->type || SVC_SNMPv2c == dcheck->type || SVC_SNMPv3 == dcheck->type)
{
zbx_free(dcheck->snmp_community);
zbx_free(dcheck->snmpv3_securityname);
zbx_free(dcheck->snmpv3_authpassphrase);
zbx_free(dcheck->snmpv3_privpassphrase);
zbx_free(dcheck->snmpv3_contextname);
}