Re: [PHP] Checking if a host is online
From: David T-G (davidtg-php_at_justpickone.org)
Date: Sat, 29 Nov 2003 12:32:44 -0500 To: PHP General list <firstname.lastname@example.org>
...and then Jason Giangrande said...
% I'm creating an application for an Intranet that, among other things, is
% supposed to check to see if particular hosts are online, and if so, what
% their IP address is. Anyone know how I can accomplish this? I tried
% a while to execute for even a few hosts at once.
1) If you're first checking to see if it's alive and second checking for
its IP address you are, IMHO, doing it backwards :-)
2) It sounds like you're rewriting BigBrother. Check out bb4.com for
info. It absolutely rocks and I wouldn't run a real site without it.
3) At the very least, cut your ping timeout down to the smallest
acceptable; in general, a full second is plenty of time to get nearly
anywhere on your continent (ain't it great? :-) and so your intranet
should be more than happy with that allowance.
4) I know that BB has already beaten this problem, so you should also
check there, but there may be a way to ping numerous hosts at once
(netping or such). Try some googling. If nothing else, I know that you
could whip up a perl script which will fork the load and then run them in
parallel and could return the live/dead/notfound results; I don't think
that php has forking.
 My house must therefore by definition not be a real site, but it
aspires to be -- and shall whenever I can find some unallocated time :-)
HTH & HAND
-- David T-G * There is too much animal courage in (play) email@example.com * society and not sufficient moral courage. (work) firstname.lastname@example.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
- application/pgp-signature attachment: stored