Source
if (SUCCEED != zbx_ipc_async_exchange(ZBX_IPC_SERVICE_ALERTER, ZBX_IPC_ALERTER_SEND_ALERT, SEC_PER_MIN, data,
/*
** Zabbix
** 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 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.
**/
extern int CONFIG_REPORTMANAGER_FORKS;
static void trapper_process_report_test(zbx_socket_t *sock, const struct zbx_json_parse *jp)
{
zbx_user_t user;
struct zbx_json_parse jp_data;
struct zbx_json j;
if (0 == CONFIG_REPORTMANAGER_FORKS)
{
zbx_send_response(sock, FAIL, "Report manager is disabled.", CONFIG_TIMEOUT);
return;
}
zbx_user_init(&user);
if (FAIL == zbx_get_user_from_json(jp, &user, NULL))
{
zbx_send_response(sock, FAIL, "Permission denied.", CONFIG_TIMEOUT);
goto out;
}
if (SUCCEED != zbx_json_brackets_by_name(jp, ZBX_PROTO_TAG_DATA, &jp_data))
{
char *error;
error = zbx_dsprintf(NULL, "cannot find tag: %s", ZBX_PROTO_TAG_DATA);
zbx_send_response(sock, FAIL, error, CONFIG_TIMEOUT);
zbx_free(error);
goto out;
}
zbx_report_test(&jp_data, user.userid, &j);
zbx_tcp_send_bytes_to(sock, j.buffer, j.buffer_size, CONFIG_TIMEOUT);