]> git.sesse.net Git - nms/commitdiff
Remove some duplicate code.
authorroot <root@space>
Wed, 4 Apr 2007 10:06:35 +0000 (12:06 +0200)
committerroot <root@space>
Wed, 4 Apr 2007 10:06:35 +0000 (12:06 +0200)
clients/snmpfetch.pl

index bc64b60fb97cd737d56f546e305dc347eb2a48ec..74f3aa5b7da5b3aac1d8cfd411651e0a52187c01 100755 (executable)
@@ -144,7 +144,7 @@ while (1) {
                        print $avgtemp." avgtemp\n";
                        $qtemppoll->execute($switch->{'switch'},
                                        $avgtemp) or die "Could not exec qtemppoll";
-                } elsif ($switch->{'switchtype'} eq 'cisco6509') {
+                } elsif ($switch->{'switchtype'} eq 'cisco6509' && 0) {
                        # fetch load data for the entities
                        for my $i (1..5) {
                                # find the ID
@@ -269,41 +269,41 @@ sub mylog {
        printf STDERR "[%s] %s\n", $time, $msg;
 }
 
-sub switch_exec {
-       my ($cmd, $conn) = @_;
-
-       # Send the command and get data from switch
-#      $conn->dump_log(*STDOUT);
-       my @data = $conn->cmd($cmd);
-       my @lines = ();
-       foreach my $line (@data) {
-               # Remove escape-7 sequence
-               $line =~ s/\x1b\x37//g;
-               push @lines, $line;
-       }
-
-       return @lines;
-}
-
-sub switch_connect {
-       my ($ip) = @_;
-
-       my $conn = new Net::Telnet(     Timeout => $timeout,
-                                       Dump_Log => '/tmp/dumplog-tempfetch',
-                                       Errmode => 'return',
-                                       Prompt => '/es-3024|e(\-)?\d+\-\dsw>/i');
-       my $ret = $conn->open(  Host => $ip);
-       if (!$ret || $ret != 1) {
-               return (0);
-       }
-       # XXX: Just send the password as text, I did not figure out how to
-       # handle authentication with only password through $conn->login().
-       #$conn->login(  Prompt => '/password[: ]*$/i',
-       #              Name => $password,
-       #              Password => $password);
-       my @data = $conn->cmd($password);
-       # Get rid of banner
-       $conn->get;
-       return $conn;
-}
+#sub switch_exec {
+#      my ($cmd, $conn) = @_;
+#
+#      # Send the command and get data from switch
+##     $conn->dump_log(*STDOUT);
+#      my @data = $conn->cmd($cmd);
+#      my @lines = ();
+#      foreach my $line (@data) {
+#              # Remove escape-7 sequence
+#              $line =~ s/\x1b\x37//g;
+#              push @lines, $line;
+#      }
+#
+#      return @lines;
+#}
+
+#sub switch_connect {
+#      my ($ip) = @_;
+#
+#      my $conn = new Net::Telnet(     Timeout => $timeout,
+#                                      Dump_Log => '/tmp/dumplog-tempfetch',
+#                                      Errmode => 'return',
+#                                      Prompt => '/es-3024|e(\-)?\d+\-\dsw>/i');
+#      my $ret = $conn->open(  Host => $ip);
+#      if (!$ret || $ret != 1) {
+#              return (0);
+#      }
+#      # XXX: Just send the password as text, I did not figure out how to
+#      # handle authentication with only password through $conn->login().
+#      #$conn->login(  Prompt => '/password[: ]*$/i',
+#      #              Name => $password,
+#      #              Password => $password);
+#      my @data = $conn->cmd($password);
+#      # Get rid of banner
+#      $conn->get;
+#      return $conn;
+#}