zabbix-agent2/src/zabbix_server/service/service_manager.c
/******************************************************************************
 *                                                                            *
 * Function: service_update_event_severity                                    *
 *                                                                            *
 * Purpose: update cached service problem and queue service for update        *
 *                                                                            *
 ******************************************************************************/
service_update_event_severity

Purpose: update cached service problem and queue service for update
service_update_event_severity Purpose : update cached service problem and queue service for update
static void	service_update_event_severity(zbx_service_manager_t *service_manager, zbx_service_t *service,
		zbx_uint64_t eventid, int severity)
{
	int			index;
	zbx_service_problem_t	*service_problem;
	zbx_services_diff_t	services_diff_local;
	if (FAIL == (index = zbx_vector_ptr_search(&service->service_problems, &eventid,
			ZBX_DEFAULT_UINT64_PTR_COMPARE_FUNC)))
	{
		return;
	}
	service_problem = (zbx_service_problem_t *)service->service_problems.values[index];
	service_problem->severity = severity;
	services_diff_local.serviceid = service->serviceid;
	if (NULL == zbx_hashset_search(&service_manager->service_diffs, &services_diff_local))
	{
		zbx_vector_ptr_create(&services_diff_local.service_problems);
		zbx_vector_ptr_create(&services_diff_local.service_problems_recovered);
		services_diff_local.flags = ZBX_FLAG_SERVICE_UPDATE;
		zbx_hashset_insert(&service_manager->service_diffs, &services_diff_local, sizeof(services_diff_local));
	}
}
static void service_update_event_severity ( zbx_service_manager_t * service_manager , zbx_service_t * service , zbx_uint64_t eventid , int severity ) { int index ; zbx_service_problem_t * service_problem ; zbx_services_diff_t services_diff_local ; if ( FAIL == ( index = zbx_vector_ptr_search ( & service -> service_problems , & eventid , ZBX_DEFAULT_UINT64_PTR_COMPARE_FUNC ) ) ) { return ; } service_problem = ( zbx_service_problem_t * ) service -> service_problems . values [ index ] ; service_problem -> severity = severity ; services_diff_local . serviceid = service -> serviceid ; if ( NULL == zbx_hashset_search ( & service_manager -> service_diffs , & services_diff_local ) ) { zbx_vector_ptr_create ( & services_diff_local . service_problems ) ; zbx_vector_ptr_create ( & services_diff_local . service_problems_recovered ) ; services_diff_local . flags = ZBX_FLAG_SERVICE_UPDATE ; zbx_hashset_insert ( & service_manager -> service_diffs , & services_diff_local , sizeof ( services_diff_local ) ) ; } }
Function: service_update_event_severity                                    
                                                                            
 Purpose: update cached service problem and queue service for update
Function : service_update_event_severity Purpose : update cached service problem and queue service for update