Source
/*
** 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 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/>.
**/
/******************************************************************************
* *
* Purpose: processes program type (proxy) specific internal checks *
* *
* Parameters: item - [IN] item to process *
* param1 - [IN] first parameter *
* request - [IN] *
* result - [OUT] *
* *
* Return value: SUCCEED - data successfully retrieved and stored in result *
* NOTSUPPORTED - requested item is not supported *
* FAIL - not proxy specific internal check *
* *
* Comments: This function is used to process proxy specific internal checks *
* before generic internal checks are processed. *
* *
******************************************************************************/
int zbx_get_value_internal_ext_proxy(const zbx_dc_item_t *item, const char *param1,
const AGENT_REQUEST *request, AGENT_RESULT *result)
{
ZBX_UNUSED(item);
if (0 == strcmp(param1, "proxy_history"))
{
if (1 != get_rparams_num(request))
{
SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid number of parameters."));
return NOTSUPPORTED;
}
SET_UI64_RESULT(result, zbx_pb_history_get_unsent_num());
return SUCCEED;
}
if (0 == strcmp(param1, "proxy_buffer"))
{
const char *param2, *param3;
int params_num;
char *error = NULL;
params_num = get_rparams_num(request);
if (params_num < 2 || params_num > 3)
{
SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid number of parameters."));