Source
static void connector_unpack_top_result(zbx_vector_connector_stat_ptr_t *connector_stats, const unsigned char *data)
/*
** Copyright (C) 2001-2024 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/>.
**/
ZBX_PTR_VECTOR_IMPL(connector_stat_ptr, zbx_connector_stat_t *)
void connector_stat_free(zbx_connector_stat_t *connector_stat)
{
zbx_free(connector_stat);
}
static int connector_initialized;
void zbx_connector_init(void)
{
connector_initialized = CONNECTOR_INITIALIZED_YES;
}
int zbx_connector_initialized(void)
{
if (CONNECTOR_INITIALIZED_YES != connector_initialized)
return FAIL;
return SUCCEED;
}
void zbx_connector_send(zbx_uint32_t code, unsigned char *data, zbx_uint32_t size)
{
static zbx_ipc_socket_t socket;
if (CONNECTOR_INITIALIZED_YES != connector_initialized)
{
zabbix_log(LOG_LEVEL_DEBUG, "connector is not initialized: please check \"StartConnectors\""
" configuration parameter");
return;
}
/* each process has a permanent connection to connector manager */
if (0 == socket.fd)
{
char *error = NULL;
if (FAIL == zbx_ipc_socket_open(&socket, ZBX_IPC_SERVICE_CONNECTOR, SEC_PER_MIN, &error))
{
zabbix_log(LOG_LEVEL_CRIT, "cannot connect to connector manager service: %s", error);