Exemple #1
0
                $up_report = "打开报警请戳: http://monitor.xk12.cn/offreport.php?ssid=ce187194a62013ff2'&'from={$mail_to}'&'session={$use_session}'&'hostname={$report_host}'&'action=start";
                $mail = "{$use_up_time} {$report_host} 宕机... '\r'{$off_report}'\r'{$up_report}";
                mails($mail_to, $mail_head, $mail);
            }
            print "{$date} {$report_host} is down\n";
        } else {
            print "sss\n";
        }
    } else {
        $updata_report_sql = "insert into m_report (HOSTNAME,REPORT_STATUS,SESSION,CONTROL) values ('{$report_host}','OK','{$get_session_u}','OK') on duplicate key update HOSTNAME='{$report_host}',REPORT_STATUS='OK',SESSION='{$get_session_u}',CONTROL='OK'";
        $result_use = mysql_query($updata_report_sql, $db_link) or die(message(mysql_error()));
        print "{$date} {$report_host}  OK\n";
        $mail_head = "Monitor Server OK";
        $mail = "{$date} The {$report_host} is OK";
        $mail_to = "*****@*****.**";
        mails($mail_to, $mail_head, $mail);
    }
}
///*
//获取使用率异常
$monitor_sql_report_use = "select * FROM `m_report` where REPORT_STATUS != 'DOWN' and CONTROL != 'STOP' and U_CONTROL != 'STOP'";
$monitor_result_use_report = mysql_query($monitor_sql_report_use, $db_link) or die(message(mysql_error()));
while ($row_use_monitor = mysql_fetch_array($monitor_result_use_report)) {
    $report_WARN_host = $row_use_monitor['HOSTNAME'] . "";
    $report_WARN_time = $row_use_monitor['UP_TIME'] . "";
    $WARN_TIME = strtotime($report_WARN_time);
    $monitor = array("R_CPU", "R_MEM", "R_LOAD", "R_DISK");
    $count_m = count($monitor);
    for ($x = 0; $x < $count_m; $x++) {
        $cc = $monitor[$x];
        $report_WARN = $row_use_monitor[$cc] . "";
Exemple #2
0
</table>

<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
	<td width="5" valign="top"></td><td></td><td width="5"></td>
</tr>
<tr height="600" valign="top">
    <td background="../imagenes/borde_izq_tabla.png">&nbsp;</td>
    <td>&nbsp;
		<!--Todo el contenido de cada página--->
		<?php 
menu_interno();
switch ($op) {
    default:
        aprobacion_auto();
        mails();
        listado($orden, $fechai, $fechaf);
        break;
}
?>
			
		<!-- -->
	</td>
    <td width="5" background="../imagenes/borde_der_tabla.png">&nbsp;</td>
  </tr>
</table>
<?php 
include "../footer.php";
function menu_interno()
{
    ?>
function notif($id, $date, $heure)
{
    $service = Connexion::query('select statut from services where id=\'' . $id . '\'');
    $id = Connexion::query('select id from tests where service_id=\'' . $id . '\' and date=\'' . $date . '\' and heure=\'' . $heure . '\'');
    Connexion::exec('update tests set erreur=1 where id=\'' . $id[0][0] . '\'');
    if ($service[0][0] == 1) {
        var_dump($id[0][0]);
        mails($id[0][0]);
        //sms($id[0][0]);
    }
}