Source
static void rtc_notify_service(zbx_rtc_sub_t *sub, zbx_uint32_t code, const unsigned char *data, zbx_uint32_t size)
/*
** 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/>.
**/
ZBX_PTR_VECTOR_IMPL(rtc_sub, zbx_rtc_sub_t *)
ZBX_PTR_VECTOR_IMPL(rtc_hook, zbx_rtc_hook_t *)
static int zbx_json_getuint64(const char *tag, const struct zbx_json_parse *jp, zbx_uint64_t *itemid,
char **error)
{
char buffer[MAX_ID_LEN];
if (SUCCEED != zbx_json_value_by_name(jp, tag, buffer, sizeof(buffer), NULL) ||
SUCCEED != zbx_is_uint64(buffer, itemid))
{
*error = zbx_dsprintf(NULL, "cannot retrieve value of tag \"%s\"", tag);
return FAIL;
}
return SUCCEED;
}
/******************************************************************************
* *
* Purpose: process ha_failover_delay runtime command *
* *
******************************************************************************/
static void rtc_history_cache_clear(const char *data, char **out)
{
struct zbx_json_parse jp;
zbx_uint64_t itemid;
int num;
if (FAIL == zbx_json_open(data, &jp))
{
*out = zbx_dsprintf(NULL, "Invalid parameter format \"%s\"\n", data);
return;