From: Eirik Nygaard Date: Tue, 3 Apr 2007 17:05:36 +0000 (+0200) Subject: Merge from main branch. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5541bedcc39044e899a10f9dc47b755a9b51d503;hp=b11cda49056ea814b9754f9d20de8cdcad76a053;p=nms Merge from main branch. --- diff --git a/clients/ciscong.pl b/clients/ciscong.pl index 277dfcf..1a9c618 100644 --- a/clients/ciscong.pl +++ b/clients/ciscong.pl @@ -12,10 +12,10 @@ use Net::Ping; use Data::Dumper; -my $patchlist = "/root/patchlist.txt"; -my $switches = "/root/switches.txt"; -#my $patchlist = "/home/eirikn/patchlist.txt.eirik"; -#my $switches = "/home/eirikn/switches.txt.eirik"; +#my $patchlist = "/root/patchlist.txt"; +#my $switches = "/root/switches.txt"; +my $patchlist = "/home/eirikn/patchlist.txt.eirik"; +my $switches = "/home/eirikn/switches.txt.eirik"; BEGIN { require "../include/config.pm"; @@ -62,7 +62,7 @@ sub stop_vlan { sub do_distro { - my ($dip, $newip, $vlan) = @_; + my ($dip, $newip, $vlan, $switchname) = @_; my $ios = Net::Telnet::Cisco->new(Host => $dip, Errmode => 'return', @@ -110,7 +110,7 @@ sub do_distro { print "Zyxel is alive..\n"; $p->close(); - system("perl ./zyxelng.pl 192.168.1.1 $newip"); + system("perl ./zyxelng.pl 192.168.1.1 $newip $switchname"); #### @@ -129,7 +129,6 @@ open(SWITCHES, $switches) or die "Unable to open switches"; while() { my ($ip, $net, $name) = split; - print $name."\n"; if ($name =~ /e\d+-\d/) { die "We only support /26 nets for now you wanted $net" if ($net ne "26"); $switchips{$name} = $ip; @@ -154,7 +153,7 @@ sub first_run { print "Ip: $ip\n"; my $dip = $distro.".net.tg07.gathering.org"; - do_distro($dip, $ip, $vlan); + do_distro($dip, $ip, $vlan, $switch); # my ($dip, $newip, $vlan) = @_; } close(PATCHLIST); diff --git a/clients/zyxelng.pl b/clients/zyxelng.pl index e41f657..3d02996 100644 --- a/clients/zyxelng.pl +++ b/clients/zyxelng.pl @@ -16,14 +16,13 @@ use nms qw(switch_connect switch_exec); #nms::ios_close($t); -my $oldip; -my $newip; if ($#ARGV < 1) { - die "Foo $#ARGV"; + die "Not enough arguments to zyxelng.pl $#ARGV"; } -$oldip = $ARGV[0]; -$newip = $ARGV[1]; +my $oldip = $ARGV[0]; +my $newip = $ARGV[1]; +#$switchname = $ARGV[2]; my $one = 0; @@ -38,39 +37,9 @@ my $switch = switch_connect($switchip) my $cmds1 = <