Ejemplo n.º 1
0
function statisticDispatch($op)
{
    switch ($op) {
        case "statistic":
            statistic();
            break;
        case "userdetails":
            userdetails();
            break;
        case "sessiondetails":
            sessiondetails();
            break;
    }
}
Ejemplo n.º 2
0
function parse($strLine)
{
    //排除的模式
    if (preg_match('/notice.*built by gcc/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*OS: Linux/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*getrlimit\\(RLIMIT_NOFILE\\)/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*worker process/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*sched_setaffinity/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*cache loader process/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*signal .* received/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*cache manager process/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*exiting/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*gracefully shutting down/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*reconfiguring/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*-nginx_/', $strLine)) {
        return;
    }
    if (preg_match('/Time :/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*using the .* event method/', $strLine)) {
        return;
    }
    if (preg_match('/notice.*reopening logs/', $strLine)) {
        return;
    }
    //已识别模式
    if (preg_match('/cross warn: success after retry/', $strLine)) {
        statistic('cross warn: success after retry', $strLine);
        return;
    }
    if (preg_match('/cross warn: refuse after retry/', $strLine)) {
        statistic('cross warn: refuse after retry', $strLine);
        return;
    }
    if (preg_match('/cross warn: refuse by early warning/', $strLine)) {
        statistic('cross warn: refuse by early warning', $strLine);
        return;
    }
    if (preg_match('/cross warn: refuse by upstream directly/', $strLine)) {
        statistic('cross warn: refuse by upstream directly', $strLine);
        return;
    }
    //自动识别
    $arr = split(" ", $strLine);
    $key = "";
    for ($i = 0; $i < 20; $i++) {
        $arr[$i] = trim($arr[$i]);
        if (empty($arr[$i])) {
            continue;
        }
        if (preg_match('/[0-9=&\\?\\.\\/]/', $arr[$i])) {
            continue;
        }
        $key .= ' ' . $arr[$i];
    }
    statistic($key, $strLine);
}
Ejemplo n.º 3
0
    ?>
<img src="images/sign_pa.png" width="347" height="70" style="margin-bottom:20px;" />
<div class="menu_bg">
<div class="menu_center">
	<a href="index.php" title="Home" class="menu_txt">Home</a>
	<a href="index.php?id=1" title="Settings" class="menu_txt">Settings</a>
    <a href="index.php?id=2" title="Tiles" class="menu_txt">Tiles</a>
    <a href="index.php?id=3" title="Articles" class="menu_txt">Articles</a>
    <a href="index.php?id=4" title="Message to Users" class="menu_txt">Messages to Users</a>
</div>
<a href="index.php?logout_admin=1" title="Logout" class="logout"></a>				
</div>
<?php 
    $id = addslashes(strip_tags(trim($_GET['id'])));
    if (!$id) {
        statistic();
    }
    if ($id == 1) {
        change_password();
    }
    if ($id == 2) {
        tails($id);
    }
    if ($id == 3) {
        articles($id);
    }
    if ($id == 4) {
        messages($id);
    }
    if ($id == 9) {
        images($id);
?>
<img src="images/sign_pa.png" width="347" height="70" style="margin-bottom:20px;" />
<div class="menu_bg">
<div class="menu_center">
	<a href="index.php" title="Home" class="menu_txt">Home</a>
	<a href="index.php?id=1" title="Settings" class="menu_txt">Settings</a>
    <a href="index.php?id=2" title="Tiles" class="menu_txt">Tiles</a>
    <a href="index.php?id=3" title="Articles" class="menu_txt">Articles</a>
    <a href="index.php?id=4" title="Message to Users" class="menu_txt">Messages to Users</a>
</div>
<a href="index.php?logout_admin=1" title="Logout" class="logout"></a>				
</div>
<?
$id = addslashes(strip_tags(trim($_GET['id'])));

if(!$id){statistic();}
if($id==1){change_password();}
if($id==2){tails($id);}
if($id==3){articles($id);}
if($id==4){messages($id);}
if($id==9){images($id);}

}
?>
<br /><br />
 
<div class="push"></div>
 
</center>
</div>
<div class="stopka"><? stopka(); ?></div>