Exemplo n.º 1
0
function zarafa_watchdog(){
	$pid_path="/var/run/zarafa-server.pid";
	$master_pid=trim(@file_get_contents($pid_path));
	$text[]="This is watchdog the report for Zarafa server ";
	$text[]="Pid: $master_pid";
	
	
	if(!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)){
		$text[]="Running No : -> running watchdog";
		$text[]="Process report: ".zarafa_server();
	}else{
		$text[]="Running Yes :";
	}
	
	$text[]="Mysql server status:\n---------------\n".mysql_server();
	
	$GLOBALS["CLASS_UNIX"]->send_email_events("Zarafa watchdog report",@implode("\n",$text),"mailbox");
	
}		
Exemplo n.º 2
0
function zarafa_watchdog()
{
    $enabled = $GLOBALS["CLASS_SOCKETS"]->GET_INFO("ZarafaEnableServer");
    if (!is_numeric($enabled)) {
        $enabled = 1;
    }
    if ($enabled == 0) {
        return;
    }
    $pid_path = "/var/run/zarafa-server.pid";
    $master_pid = trim(@file_get_contents($pid_path));
    $text[] = "This is watchdog the report for Zarafa server ";
    $text[] = "Pid: {$master_pid}";
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)) {
        $text[] = "Running No : -> running watchdog";
        $text[] = "Process report: " . zarafa_server();
    } else {
        $text[] = "Running Yes :";
    }
    $text[] = "Mysql server status:\n---------------\n" . mysql_server();
    $GLOBALS["CLASS_UNIX"]->send_email_events("Zarafa watchdog report", @implode("\n", $text), "mailbox");
}