NYCPHP Meetup

NYPHP.org

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

Meitar Moscovitz meitarm at gmail.com
Tue Sep 14 00:04:00 EDT 2004


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



More information about the talk mailing list