zabbix-agent2/src/zabbix_agent/zbxkstat.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_kstat_refresh                                                *
 *                                                                            *
 * Purpose: refreshes kstat environment                                       *
 *                                                                            *
 * Parameters: error - [OUT] the error message                                *
 *                                                                            *
 * Return value: SUCCEED - the kstat environment was refreshed successfully   *
 *               FAIL - otherwise                                             *
 *                                                                            *
 ******************************************************************************/
zbx_kstat_refresh

Purpose: refreshes kstat environment

Parameters: error - [OUT] the error message

Return value: SUCCEED - the kstat environment was refreshed successfully
FAIL - otherwise
zbx_kstat_refresh Purpose : refreshes kstat environment Parameters : error - [ OUT ] the error message Return value : SUCCEED - the kstat environment was refreshed successfully FAIL - otherwise
static int	zbx_kstat_refresh(char **error)
{
	kid_t	kid;
	if (-1 == (kid = kstat_chain_update(kc)))
	{
		*error = zbx_dsprintf(*error, "failed to update kstat chain: %s", zbx_strerror(errno));
		return FAIL;
	}
	if (0 != kid)
		kc_id = kid;
	if (NULL == (kc_vminfo = kstat_lookup(kc, "unix", -1, "vminfo")))
	{
		*error = zbx_dsprintf(*error, "failed to find vminfo data: %s", zbx_strerror(errno));
		return FAIL;
	}
	return SUCCEED;
}
static int zbx_kstat_refresh ( char * * error ) { kid_t kid ; if ( -1 == ( kid = kstat_chain_update ( kc ) ) ) { * error = zbx_dsprintf ( * error , " " , zbx_strerror ( errno ) ) ; return FAIL ; } if ( 0 != kid ) kc_id = kid ; if ( NULL == ( kc_vminfo = kstat_lookup ( kc , " " , -1 , " " ) ) ) { * error = zbx_dsprintf ( * error , " " , zbx_strerror ( errno ) ) ; return FAIL ; } return SUCCEED ; }
Function: zbx_kstat_refresh                                                
                                                                            
 Purpose: refreshes kstat environment                                       
                                                                            
 Parameters: error - [OUT] the error message                                
                                                                            
 Return value: SUCCEED - the kstat environment was refreshed successfully   
               FAIL - otherwise
Function : zbx_kstat_refresh Purpose : refreshes kstat environment Parameters : error - [ OUT ] the error message Return value : SUCCEED - the kstat environment was refreshed successfully FAIL - otherwise