]> git.sesse.net Git - nms/commitdiff
Push switchname to zyxelng.
authorEirik Nygaard <eirikn@space>
Tue, 3 Apr 2007 17:04:32 +0000 (19:04 +0200)
committerEirik Nygaard <eirikn@space>
Tue, 3 Apr 2007 17:04:32 +0000 (19:04 +0200)
clients/ciscong.pl

index 277dfcf13dc7ebc712983633ac614ddb259705d0..1a9c6182ab73bf52366472d4ca866ca25a42d4a6 100644 (file)
@@ -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(<SWITCHES>) {
        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);