<?php
/**
 * 每隔1小时杀死所有的监控进程，防止僵死
 * * 1 * * * * 
 */
$process = `ps aux | grep Monitor | grep -v grep | grep -v sh`;
$list = explode("\n", $process);
if (empty($list))
{
    exit;
}

foreach ($list as $value)
{
    if (!empty($value))
    {
        preg_match('/www\s*(\d+)/is', $value, $match);
        if ($match[1])
        {
            exec("kill $match[1]");
        }
    }
}