Consulta sobre Ping usando PHP en un IIS 5
| From: | Ing. Héctor Dávila Luman | Date: | Thu, 13 May 2004 12:24:51 +0000 |
| Subject: | Consulta sobre Ping usando PHP en un IIS 5 | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-48517@lists.php.net to get a copy of this message | ||
Estoy tratando de ejecutar el comando ping usando PHP en un server IIS5
instalado en XP, pero sin exito, podrían darme una mano con este codigo ?
<!-- monitor.php -->
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="60">
</head>
<body>
<h2>Monitoreo de Servers</h2>
<table border=1 cellspacing=3>
<tr>
<?php
$servidores = array (
"server1.com" => "200.215.128.83",
"server2.com" => "200.215.128.241"
);
while (list($site,$ip) = each($servidores)) {
$comando = "ping -n 1 " . $ip;
$salida = shell_exec($comando);
echo
"<td>".$site."<br>".$ip."<br>"."Estado:";
if ( ereg("bytes de",$salida) ) {
echo "<b>online</b></td>";
} else {
echo "<font color=red><b>no responde</b></font></td>";
}
}
?>
</tr>
</table>
</body>
</html>
<!-- fin -->
Desde ya muchas gracias