Checking if a host is online
From: Jason Giangrande (jason_at_giangrande.org)
Date: 11/29/03
- Next message: Adam Maas: "Re: [PHP] Checking if a host is online"
- Previous message: Per Jessen: "what's the story with html_entity_decode?"
- Next in thread: Adam Maas: "Re: [PHP] Checking if a host is online"
- Reply: Adam Maas: "Re: [PHP] Checking if a host is online"
- Reply: David T-G: "Re: [PHP] Checking if a host is online"
- Reply: Duncan: "Re: [PHP] Checking if a host is online"
- Reply: Jacob_at_Keystreams.Com: "Re: [PHP] Checking if a host is online"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "php-general@lists.php.net" <php-general@lists.php.net> Date: Sat, 29 Nov 2003 12:17:07 -0500
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 it gets the IP address sometimes even if the host is not
active, because a DNS record for the system still exists. I also looked
into the gethostbyname() function, but that has similar problems to
using the external host command. I also tried to use an external ping
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.
Anyone ever do this king=d of thing before or have any suggestions on
what might work?
-- Jason Giangrande <jason@giangrande.org> http://www.giangrande.org http://www.dogsiview.com
- application/pgp-signature attachment: This is a digitally signed message part
- Next message: Adam Maas: "Re: [PHP] Checking if a host is online"
- Previous message: Per Jessen: "what's the story with html_entity_decode?"
- Next in thread: Adam Maas: "Re: [PHP] Checking if a host is online"
- Reply: Adam Maas: "Re: [PHP] Checking if a host is online"
- Reply: David T-G: "Re: [PHP] Checking if a host is online"
- Reply: Duncan: "Re: [PHP] Checking if a host is online"
- Reply: Jacob_at_Keystreams.Com: "Re: [PHP] Checking if a host is online"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|