B
Bhaskar Kurapati
Hi,
I am using Net::Telnet::Cisco module to add some rules in CMTS(Cisco
Router) ... when I am entering enable mode ...
"$session->enable("enable_password")" (see code below) always returns
"1" even when password is wrong. According to Net::Telnet::Cisco
module documentation it should return "1" on success and undefined
when password is wrong or can not enter enable mode.
use Net::Telnet::Cisco;
my($session, $ok, @output);
$session = Net::Telnet::Cisco->new(Host => '123.123.123.123');
$session->login('login', 'password');
# Enable mode
$ok = $session->enable("xxxxxxx");
print "$ok"; # This line always pring "1" even when enable password
is wrong
if ($ok) {
@output = $session->cmd('show privilege');
print "My privileges: @output\n";
} else {
# this loop is never executed even when enable password is wrong
warn "Can't enable: " . $session->errmsg;
}
$session->close;
What might be the problem here ???
thanks in advance
Bhaskar Kurapati
I am using Net::Telnet::Cisco module to add some rules in CMTS(Cisco
Router) ... when I am entering enable mode ...
"$session->enable("enable_password")" (see code below) always returns
"1" even when password is wrong. According to Net::Telnet::Cisco
module documentation it should return "1" on success and undefined
when password is wrong or can not enter enable mode.
use Net::Telnet::Cisco;
my($session, $ok, @output);
$session = Net::Telnet::Cisco->new(Host => '123.123.123.123');
$session->login('login', 'password');
# Enable mode
$ok = $session->enable("xxxxxxx");
print "$ok"; # This line always pring "1" even when enable password
is wrong
if ($ok) {
@output = $session->cmd('show privilege');
print "My privileges: @output\n";
} else {
# this loop is never executed even when enable password is wrong
warn "Can't enable: " . $session->errmsg;
}
$session->close;
What might be the problem here ???
thanks in advance
Bhaskar Kurapati