SHOW:
|
|
- or go back to the newest paste.
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 3 | <head> | |
| 4 | <meta http-equiv="Content-Type" content="text/html" charset="" /> | |
| 5 | <META HTTP-EQUIV="Refresh" CONTENT="20"> | |
| 6 | <title>Servidor de Ping UAM</title> | |
| 7 | <link rel="stylesheet" href="3col_rightNav.css" type="text/css"> | |
| 8 | <style type="text/css"> | |
| 9 | body {
| |
| 10 | background-color:#000; | |
| 11 | } | |
| 12 | ||
| 13 | td {
| |
| 14 | background-color:#000; | |
| 15 | font-size:small; | |
| 16 | color:#FFF; | |
| 17 | font-family:"Courier New", Courier, monospace; | |
| 18 | ||
| 19 | } | |
| 20 | </style> | |
| 21 | </head> | |
| 22 | <body><div id="masthead"> | |
| 23 | <h1 align="center" id="siteName"><font color="#00FF33" face="Courier New, Courier, monospace">..::Monitoramento de servidores::..</font></h1> | |
| 24 | </div> | |
| 25 | <table width="800" align="center"> | |
| 26 | <tr> | |
| 27 | <td width="107"><font color="#FFFFFF" face="Courier New, Courier, monospace">Srv - Servidor</font></td> | |
| 28 | <td width="125"><font color="#FFFFFF" face="Courier New, Courier, monospace">T - Torniquete</font></td> | |
| 29 | <td width="125"><font color="#FFFFFF" face="Courier New, Courier, monospace">Sw - Switch</font></td> | |
| 30 | <td width="125">C - Catraca</td> | |
| 31 | </tr> | |
| 32 | <tr> | |
| 33 | <td><font color="#FFFFFF" face="Courier New, Courier, monospace">Vm - Virtual Machine</font></td> | |
| 34 | <td><font color="#FFFFFF" face="Courier New, Courier, monospace">R - Relogio de ponto</font></td> | |
| 35 | <td>Det - Detector de metal</td> | |
| 36 | <td>Imp - Impressora</td> | |
| 37 | </tr> | |
| 38 | </table> | |
| 39 | <table width="892" height="445" align="center"> | |
| 40 | <tr> | |
| 41 | - | <td width="144"><span class="content"> |
| 41 | + | <?php |
| 42 | - | <?php |
| 42 | + | $arquivos = range(1, 12); |
| 43 | - | $arrayL = fopen("templates/beez_20/ping/srv01.txt","r");
|
| 43 | + | foreach($arquivos as $arquivo) {
|
| 44 | echo '<td width="144"><span class="content">'; | |
| 45 | - | |
| 45 | + | $arquivo = sprintf("%02d", $arquivo);
|
| 46 | - | while(!feof($arrayL)){
|
| 46 | + | $arrayL = explode(file_get_contents("templates/beez_20/ping/srv{$arquivo}.txt"), "\n");
|
| 47 | - | $linha =fgets($arrayL, 999); |
| 47 | + | |
| 48 | - | $nome = strtok($linha, ":"); |
| 48 | + | foreach($arrayL as $servers) {
|
| 49 | - | $pingando = " "; |
| 49 | + | list($nome, $numeroip) = explode($servers, ":"); |
| 50 | - | $numeroip = strtr(strrchr($linha,":"), ":", " "); |
| 50 | + | |
| 51 | - | |
| 51 | + | if($numeroip !== null) |
| 52 | - | if(empty($numeroip)){
|
| 52 | + | echo "Final, sem ip"; |
| 53 | - | echo "Final, sem ip"; |
| 53 | + | else |
| 54 | - | exit; |
| 54 | + | if(!fsockopen($numeroip, 80, $errono, $errstr, 3)) |
| 55 | - | }else{
|
| 55 | + | echo "<font color=#FF0000>$nome</font>"."<img src=templates/beez_20/ping/imgs/offline.png align=right>"."<br>"; |
| 56 | - | |
| 56 | + | else |
| 57 | - | $pingando = shell_exec("ping -c 1 $numeroip");
|
| 57 | + | echo "<font color=#00CC00>$nome</font>"."<img src=templates/beez_20/ping/imgs/online.png align=right>"."<br>"; |
| 58 | - | |
| 58 | + | |
| 59 | - | if(!preg_match("/bytes from/",$pingando)){
|
| 59 | + | |
| 60 | - | echo "<font color=#FF0000>$nome</font>"."<img src=templates/beez_20/ping/imgs/offline.png align=right>"."<br>"; |
| 60 | + | echo '</span></td>'; |
| 61 | - | |
| 61 | + | |
| 62 | - | }else{
|
| 62 | + | |
| 63 | - | echo "<font color=#00CC00>$nome</font>"."<img src=templates/beez_20/ping/imgs/online.png align=right>"."<br>"; |
| 63 | + | |
| 64 | - | |
| 64 | + | |
| 65 | - | } |
| 65 | + | |
| 66 | - | |
| 66 | + |