zabbix-agent2/src/libs/zbxdbcache/dbconfig.c
/******************************************************************************
 *                                                                            *
 * Function: DCget_data_expected_from                                         *
 *                                                                            *
 * Purpose: Returns time since which data is expected for the given item. We  *
 *          would not mind not having data for the item before that time, but *
 *          since that time we expect data to be coming.                      *
 *                                                                            *
 * Parameters: itemid  - [IN] the item id                                     *
 *             seconds - [OUT] the time data is expected as a Unix timestamp  *
 *                                                                            *
 ******************************************************************************/
DCget_data_expected_from

Purpose: Returns time since which data is expected for the given item. We
would not mind not having data for the item before that time, but
since that time we expect data to be coming.

Parameters: itemid  - [IN] the item id
seconds - [OUT] the time data is expected as a Unix timestamp
DCget_data_expected_from Purpose : Returns time since which data is expected for the given item . We would not mind not having data for the item before that time but since that time we expect data to be coming . Parameters : itemid - [ IN ] the item id seconds - [ OUT ] the time data is expected as a Unix timestamp
int	DCget_data_expected_from(zbx_uint64_t itemid, int *seconds)
{
	const ZBX_DC_ITEM	*dc_item;
	const ZBX_DC_HOST	*dc_host;
	int			ret = FAIL;
	RDLOCK_CACHE;
	if (NULL == (dc_item = (const ZBX_DC_ITEM *)zbx_hashset_search(&config->items, &itemid)))
		goto unlock;
	if (ITEM_STATUS_ACTIVE != dc_item->status)
		goto unlock;
	if (NULL == (dc_host = (const ZBX_DC_HOST *)zbx_hashset_search(&config->hosts, &dc_item->hostid)))
		goto unlock;
	if (HOST_STATUS_MONITORED != dc_host->status)
		goto unlock;
	*seconds = MAX(dc_item->data_expected_from, dc_host->data_expected_from);
	ret = SUCCEED;
unlock:
	UNLOCK_CACHE;
	return ret;
}
int DCget_data_expected_from ( zbx_uint64_t itemid , int * seconds ) { const ZBX_DC_ITEM * dc_item ; const ZBX_DC_HOST * dc_host ; int ret = FAIL ; RDLOCK_CACHE ; if ( NULL == ( dc_item = ( const ZBX_DC_ITEM * ) zbx_hashset_search ( & config -> items , & itemid ) ) ) goto unlock ; if ( ITEM_STATUS_ACTIVE != dc_item -> status ) goto unlock ; if ( NULL == ( dc_host = ( const ZBX_DC_HOST * ) zbx_hashset_search ( & config -> hosts , & dc_item -> hostid ) ) ) goto unlock ; if ( HOST_STATUS_MONITORED != dc_host -> status ) goto unlock ; * seconds = MAX ( dc_item -> data_expected_from , dc_host -> data_expected_from ) ; ret = SUCCEED ; unlock : UNLOCK_CACHE ; return ret ; }
Function: DCget_data_expected_from                                         
                                                                            
 Purpose: Returns time since which data is expected for the given item.
Function : DCget_data_expected_from Purpose : Returns time since which data is expected for the given item .