Viewing file: quita_ac.php (1.18 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
date_default_timezone_set("Europe/Madrid"); $handle=fopen("/home/papyr225/public_html/high/high.txt","a+"); fwrite($handle,"INICIO:".date("Y-m-d H:i:s"));
for ($f=1;$f<=18;$f++){ flush(); $gestor = fopen("/home/papyr225/public_html/.htaccess", "r"); if ($gestor) { $buffer = fread($gestor, 100); //echo $buffer."<br>"; if (strpos($buffer,"high_cpu")>0){ // tenemos el mensaje fclose($gestor); $conn=&mysql_connect('localhost','papyr225_1','ilvm2rg2'); $sql="insert into papyr225_papyre.high (fecha,aviso) values ('".date('Y-m-d H:i:s')."','acaba de fallar')"; mysql_query($sql,$conn); $gestor2 = fopen("/home/papyr225/public_html/.htaccess", "w+"); fwrite($gestor2,"Options All -Indexes ".chr(10)."####"); fclose($gestor2); //echo "<br>CORRIGIENDO<BR>"; }else{ // todo est� OK if ($aviso){ $sql="insert into high (fecha,aviso) values ('".date('Y-m-d H:i:s')."','ok')"; //mysql_query($sql,$conn); fclose($gestor); } }
}else{ echo " no se puede abrir"; die(); }
flush(); sleep(3);
} fwrite($handle," FIN:".date("Y-m-d H:i:s").chr(10)); fclose($handle); //echo "<br>".date("H:i:s")."<br>"; ?>
|