[Techtalk] Perl tutorials

Charlotte Oliver COliver at casedesign.com
Tue Oct 22 15:32:41 EST 2002


Heya folks --

I am going to write a script that will send out pings and, if a ping
fails to return, change the default IP and gateway of a box.  The idea
behind this is that if our T1 dies, our DSL line will take over without
any additional network equipment.  The box itself is Windows NT 4.0
(bleh, but it's what we run) and I've figured out how to change the
gateway and IP (route del and route add) sucessfully.  The part I'm not
sure about is the interpretation of a ping.

I'm guessing that Perl would be a good language for this and I see that
Perl is available on a Windows platform.  I'm told it doesn't work well
on a NT platform, but I'm building a testbox to find out if this is true
or not.  I've some experience with C and bash scripts, but no other
serious programming experience.  This is the pseudocode I came up with
to try and attempt this:

Start
ping T1_ip
read $output
If $output = "Destination not reachable",
	route del  0.0.0.0 mask 255.255.254.0  T1_IP
	route del  0.0.0.0 mask 0.0.0.0        T1_IP
	route add  0.0.0.0 mask 255.255.255.0  DSL_IP
	route add  0.0.0.0 mask 0.0.0.0	   DSL_IP
else
	{Null}
fi
Stop

Does anyone have further suggestions or URLs of good online tutorials?
Are there other thoughts on whether or not this is a good solution for
network design?

---
Charlotte Oliver
Junior Systems Engineer 
Case Design/Remodeling, Inc.



More information about the Techtalk mailing list