Re: [PHP] Checking if a host is online

From: Jacob_at_Keystreams.Com (jacob_at_keystreams.com)
Date: 11/30/03


Date: Sat, 29 Nov 2003 17:10:22 -0700


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 used it in the past to monitor a small web cluster and it worked nicely. Additionally, freshmeat has a bunch of network monitors listed
written in PHP.

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 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?

-- 
"No, mon, let's go home to Jamaica. I and I been in Babylon too long." -- Homer Simpson


Relevant Pages

  • Re: How do I insert a cgi script into Publisher page?
    ... As you were working out your PHP form, did you happen to run across this ... My host is www.swissnetsolutions.ch and yes, ... I was told that they do not have a cgi form ... Though Publisher uses 'ISP' I think that may be confusing to some ...
    (microsoft.public.publisher.webdesign)
  • Re: working with mysql
    ... throw new Exception('Error connecting to host. ... I would like to be able to get php to pull the data. ... Did you take out your throw statement and put in the echo like I asked? ...
    (comp.lang.php)
  • Re: Publisher 2000, php and more
    ... I also use this host for my other sites and client sites. ... What are you wanting to use PHP for? ... > This is probably a bit off topic, but I am using Publisher 2000 to produce ... > research hosts, I have decided that I need not only FrontPage extensions, ...
    (microsoft.public.publisher.webdesign)
  • Re: Publisher 2000, php and more
    ... > Don't know about creating web pages with 2000, but I do know my web host ... I have resisted changing to FrontPage or more suitable ... >> My current website host does not allow FrontPage extensions, ... >> but also think I would like to start incorporating PHP, ...
    (microsoft.public.publisher.webdesign)
  • Re: Transfering Website, PHP Configuration
    ... My client wants to transfer their site from a Linux server to ... files,and what configurations need to be made in order to do the ... Your new host probably has a control panel (if they ... Sure this has to do with PHP. ...
    (comp.lang.php)