Re: Checking if a host is online
| From: | David T-G | Date: | Sat, 29 Nov 2003 17:32:44 +0000 |
| Subject: | Re: Checking if a host is online | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171361@lists.php.net to get a copy of this message | ||
Jason --
..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[1] 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.
[1] 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
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!