[PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
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 using exec(host $host); (where $host is the hostname) and while this gets the IP

Re: [PHP] Checking if a host is online

2003-11-29 Thread Adam Maas
Jason Giangrande wrote: 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 using exec(host $host); (where $host is the hostname) and

Re: [PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
On Sat, 2003-11-29 at 12:20, Adam Maas wrote: why not try: passthru(ping $host); Adam That still takes a little while to execute on multiple hosts, Plus I need to modify the output of the command to print just the IP address and discard the rest of the output. -- Jason Giangrande

Re: [PHP] Checking if a host is online

2003-11-29 Thread Adam Maas
Adam Maas wrote: Jason Giangrande wrote: 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 using exec(host $host); (where $host is

Re: [PHP] Checking if a host is online

2003-11-29 Thread David T-G
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

Re: [PHP] Checking if a host is online

2003-11-29 Thread Duncan
Jason Giangrande said: command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. fping may help. Running a background job that just monitors ping status and

Re: [PHP] Checking if a host is online

2003-11-29 Thread Jason Giangrande
On Sat, 2003-11-29 at 12:32, David T-G wrote: 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

Re: [PHP] Checking if a host is online

2003-11-29 Thread [EMAIL PROTECTED]
This may be OT but have you looked at Netsaint (http://www.netsaint.org/ and http://www.netsaint.org/indexold.php), now called Nagios (http://www.nagios.org/) by the looks of it. Note: It's not written in PHP from what I remember. You may be able to get some ideas from it or even use it. I've