Source
static int get_icmpping_nearestindex(icmpitem_t *items, int items_count, int count, int interval, int size, int timeout)
/*
** 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.
**/
/* defines for `fping' and `fping6' to successfully process pings */
extern ZBX_THREAD_LOCAL unsigned char process_type;
extern unsigned char program_type;
extern ZBX_THREAD_LOCAL int server_num, process_num;
/******************************************************************************
* *
* Purpose: process new item value *
* *
******************************************************************************/
static void process_value(zbx_uint64_t itemid, zbx_uint64_t *value_ui64, double *value_dbl, zbx_timespec_t *ts,
int ping_result, char *error)
{
DC_ITEM item;
int errcode;
AGENT_RESULT value;
zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
DCconfig_get_items_by_itemids(&item, &itemid, &errcode, 1);
if (SUCCEED != errcode)
goto clean;
if (ITEM_STATUS_ACTIVE != item.status)
goto clean;
if (HOST_STATUS_MONITORED != item.host.status)