Tema: Ping con php
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/04/2008, 15:30
Avatar de NUCKLEAR
NUCKLEAR
Moderador radioactivo
 
Fecha de Ingreso: octubre-2005
Ubicación: Cordoba-Argentina
Mensajes: 5.688
Antigüedad: 18 años, 6 meses
Puntos: 890
Re: Ping con php

Tengo algoo, a ver si te sirve
Código:
<?php
/*
 * Created on 26/04/2008
  */
  exec ("/bin/ping -c 5 www.google.com", $respuesta); 
 //tenes que saber la ruta del comando ping en tu server
  echo "<pre>" . join("\r\n", $respuesta)."</pre>";
?>
Esto devuelve
PING www.l.google.com (209.85.165.104) 56(84) bytes of data.
64 bytes from eo-in-f104.google.com (209.85.165.104): icmp_seq=1 ttl=246 time=205 ms
64 bytes from eo-in-f104.google.com (209.85.165.104): icmp_seq=2 ttl=246 time=202 ms
64 bytes from eo-in-f104.google.com (209.85.165.104): icmp_seq=3 ttl=246 time=201 ms
64 bytes from eo-in-f104.google.com (209.85.165.104): icmp_seq=4 ttl=246 time=203 ms
64 bytes from eo-in-f104.google.com (209.85.165.104): icmp_seq=5 ttl=246 time=203 ms

--- www.l.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4012ms
rtt min/avg/max/mdev = 201.406/203.090/205.172/1.256 ms

Saludos
__________________
Drupal Argentina