NYCPHP Meetup

NYPHP.org

[nycphp-talk] Is PHP a good choice for automating network monitoring?

corey szopinski corey at domanistudios.com
Tue Sep 14 10:21:50 EDT 2004


I¹m not positive that this idea will work in a CLI-only environment, but
I¹ve had very good luck with a service from dyndns.org. To get around the
rolling DHCP ip issue, this service let¹s you use a DNS entry as a sort of
proxy. On the client (Mac & Windows for sure), a small daemon or service
periodically sends out the ip address (I think there¹s a reverse ping or
something) to dyndns.org. They handle the DNS->IP mapping on their end. I¹ve
had it set up and running for a couple of years on various computers and it
works nicely.

-corey


On 9/14/04 12:04 AM, "Meitar Moscovitz" <meitarm at gmail.com> wrote:

> Hello all,
> 
> Not a Gmail-related post: as you can see, I already have an account.  ;)
> 
> Instead, I'm wondering if it's possible for PHP to monitor my
> computer's IP address, or more accurately, my local network's WAN IP
> address, so that it can alert me when the address changes via a DHCP
> offer(). Here's the situation:
> 
> I have a computer at my parent's house constantly running and
> connected to the Internet via a Road Runner account. I'd like to
> connect to it remotely sometimes. The problem is, as you know, Road
> Runner uses DHCP to designate their subscriber modem's IP addresses,
> and this means it changes all the time. I'm savvy enough to configure
> an SSH server on the machine locally and configure the router over
> there to let requests from the Internet through, but I obviously can't
> figure out where that computer is unless I call my parents and direct
> her to whatismyip.com.
> 
> So the question is, does PHP have any capability to discover and
> monitor a network's WAN IP address?
> 
> I'd imagine that the solution would be a PHP-CLI script invoked with
> cron or a similar utility which would then email me the current
> address. (I suppose Windows has the Task Scheduler for this, and I
> guess this would also require setting up some kind of mail server, or
> else use something like http://phpmailer.sourceforge.net/ suggested by
> Dan, earlier. (I'm also sorry for not promptly thanking you for that
> suggestion, Dan. I really appreciated the pointer!)). But most
> importantly for right now, I'm not sure this is the best way to go
> about it in the first place.
> 
> Can anyone offer some good points why I shouldn't attempt this
> project? I'd be grateful if you save me some time.  :)  Thanks in
> advance.
> 
> -Meitar Moscovitz
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org


DOMANI STUDIOS

Corey Szopinski
Technology Director
   
corey at domanistudios.com
55 Washington St. Suite 822
Brooklyn, NY 11201
212.920.8135  x116 






More information about the talk mailing list