From: Eirik Nygaard Date: Tue, 3 Apr 2007 17:04:32 +0000 (+0200) Subject: Push switchname to zyxelng. X-Git-Url: https://git.sesse.net/?p=nms;a=commitdiff_plain;h=61570c6028823eab9bfc09b3bb17559111d5f48f Push switchname to zyxelng. --- 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);