#!/usr/bin/perl
-use lib '../include';
-use nms;
-
-# Seconds to wait for connection
-my $timeout = 15;
-
-
use warnings;
use strict;
-use Switch;
use CGI;
-use Net::Telnet;
use DBI;
use Data::Dumper;
+use lib '../include';
+use nms;
# Grab from .htaccess-authentication
my $user = $ENV{'REMOTE_USER'};
return @lines;
}
-sub switch_connect($) {
- my ($ip) = @_;
-
- my $conn = new Net::Telnet( Timeout => $timeout,
- Errmode => 'return',
- Prompt => '/(es3024|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);
- $conn->cmd($nms::config::zyxel_password);
- # Get rid of banner
- $conn->get;
- return ($conn);
-}
-
sub parse_range($) {
my $switches = $_;
my @range;