Hi guys,
How can I ping a list of 70 ip addresses? I need to ping 70 ip addresses I binded to my server to make sure they are all online.
How would I do that most easily? Is there a way to do it in php or how can i do it totally?
ip_list.txt content's
66.66.66.10
66.66.66.11
66.66.66.12
66.66.66.13
66.66.70.70
66.66.70.71
66.66.70.72
66.66.70.73
66.66.70.74
66.66.110.210
66.66.110.211
66.66.110.212
66.66.110.213
etc...
Thanks in advance, this is important!
How can I ping a list of 70 ip addresses?
Moderator: General Moderators
-
jclarkkent2003
- Forum Contributor
- Posts: 123
- Joined: Sat Dec 04, 2004 9:14 pm
-
jclarkkent2003
- Forum Contributor
- Posts: 123
- Joined: Sat Dec 04, 2004 9:14 pm
lol, now i feel stupid.....
Thanks mate~
Oh hold up, how about on a windows xp sp 2 pro computer using xampp? I don't think that works quite right.
That didn't output the ping response and ttl time... Did i miss something? Thansk~
Thanks mate~
Oh hold up, how about on a windows xp sp 2 pro computer using xampp? I don't think that works quite right.
Code: Select all
<?
set_time_limit(600); // Ten minutes
$string = "http://www.dnsstuff.com/tools/ping.ch?ip=";
$file = file("ip_list.txt");
for($k=0;$k<sizeof($file);$k++)
{
$ip = $file[$k];
exec("ping $ip"); flush();ob_flush();
//$full_ping_url = $string.$ip;
//include("$full_ping_url");
}
?>- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
try
because...
Code: Select all
var_export(exec())PHP Manual wrote: output
If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().