Exemplo n.º 1
0
function build_client_mode(){
	$sock=new sockets();
	$ActAsASyslogClient=$sock->GET_INFO("ActAsASyslogClient");
	if(!is_numeric($ActAsASyslogClient)){
		echo "Starting......: syslog client parameters not defined, aborting tasks\n";
	}
	
	if(is_file("/etc/default/syslogd")){
		echo "Starting......: syslog client old syslog mode\n";
		build_client_mode_debian();
		return;
	}
	
	if(is_dir("/etc/rsyslog.d")){
		echo "Starting......: syslog client rsyslog mode\n";
		build_server_mode_ubuntu();
	}
}
Exemplo n.º 2
0
function build_client_mode()
{
    $sock = new sockets();
    $ActAsASyslogClient = $sock->GET_INFO("ActAsASyslogClient");
    $ActAsASyslogSMTPClient = $sock->GET_INFO("ActAsASyslogSMTPClient");
    if (!is_numeric($ActAsASyslogSMTPClient)) {
        $ActAsASyslogSMTPClient = 0;
    }
    if (!is_numeric($ActAsASyslogClient)) {
        $ActAsASyslogClient = 0;
    }
    $EnableRemoteSyslogStatsAppliance = $sock->GET_INFO("EnableRemoteSyslogStatsAppliance");
    if (!is_numeric($EnableRemoteSyslogStatsAppliance)) {
        $EnableRemoteSyslogStatsAppliance = 0;
    }
    if ($EnableRemoteSyslogStatsAppliance == 1) {
        $ActAsASyslogClient = 1;
    }
    if ($ActAsASyslogClient == 0 or $ActAsASyslogSMTPClient == 0) {
        echo "Starting......: " . date("H:i:s") . " syslog client parameters not defined, aborting tasks\n";
    }
    if (is_file("/etc/default/syslogd")) {
        echo "Starting......: " . date("H:i:s") . " syslog client old syslog mode\n";
        build_client_mode_debian();
        shell_exec("/etc/init.d/auth-tail restart");
        return;
    }
    if (is_dir("/etc/rsyslog.d")) {
        echo "Starting......: " . date("H:i:s") . " syslog client rsyslog mode\n";
        build_client_mode_ubuntu();
        shell_exec("/etc/init.d/auth-tail restart");
    }
}