zabbix-agent2/src/zabbix_server/rtc.c
/******************************************************************************
 *                                                                            *
 * Function: rtc_change_loglevel                                              *
 *                                                                            *
 * Purpose: process log level changes affecting main/ha manager processes     *
 *                                                                            *
 ******************************************************************************/
rtc_change_loglevel

Purpose: process log level changes affecting main/ha manager processes
rtc_change_loglevel Purpose : process log level changes affecting main / ha manager processes
static void	rtc_change_loglevel(int command, int scope, int data)
{
	if ((ZBX_RTC_LOG_SCOPE_FLAG | ZBX_RTC_LOG_SCOPE_PID) == scope)
	{
		if (0 == data || getpid() == (pid_t)data)
			rtc_change_loglevel_main(command);
		if (0 == data || SUCCEED == zbx_ha_check_pid((pid_t)data))
			rtc_change_loglevel_ha(command);
		return;
	}
	if (ZBX_PROCESS_TYPE_MAIN == scope)
	{
		if (1 < data)
		{
			zabbix_log(LOG_LEVEL_ERR, "cannot redirect signal: \"%s #%d\" process does not exist",
					get_process_type_string((unsigned char)scope), data);
		}
		else
			rtc_change_loglevel_main(command);
	}
	else if (ZBX_PROCESS_TYPE_HA_MANAGER == scope)
	{
		if (1 < data)
		{
			zabbix_log(LOG_LEVEL_ERR, "cannot redirect signal: \"%s #%d\" process does not exist",
					get_process_type_string((unsigned char)scope), data);
		}
		else
			rtc_change_loglevel_ha(command);
	}
}
static void rtc_change_loglevel ( int command , int scope , int data ) { if ( ( ZBX_RTC_LOG_SCOPE_FLAG | ZBX_RTC_LOG_SCOPE_PID ) == scope ) { if ( 0 == data || getpid ( ) == ( pid_t ) data ) rtc_change_loglevel_main ( command ) ; if ( 0 == data || SUCCEED == zbx_ha_check_pid ( ( pid_t ) data ) ) rtc_change_loglevel_ha ( command ) ; return ; } if ( ZBX_PROCESS_TYPE_MAIN == scope ) { if ( 1 < data ) { zabbix_log ( LOG_LEVEL_ERR , " \" \" " , get_process_type_string ( ( unsigned char ) scope ) , data ) ; } else rtc_change_loglevel_main ( command ) ; } else if ( ZBX_PROCESS_TYPE_HA_MANAGER == scope ) { if ( 1 < data ) { zabbix_log ( LOG_LEVEL_ERR , " \" \" " , get_process_type_string ( ( unsigned char ) scope ) , data ) ; } else rtc_change_loglevel_ha ( command ) ; } }
Function: rtc_change_loglevel                                              
                                                                            
 Purpose: process log level changes affecting main/ha manager processes
Function : rtc_change_loglevel Purpose : process log level changes affecting main / ha manager processes