Hi anyone out there.
I am a Cisco administrator that has been chucked headfirst into the world of scripting. So starting yesterday, I have made my first script that works. yahooo. Its below if needed
I need this script to open interface dialers on a cisco router. The script below can open a file, and open a dialer via telnet, but only if I enter the router ip address, and dialer number manually. I need to dynamically (meaning automated, no human input) open any router and its associated dialers that might be in this file. The file is dynamically made, and can be split up if necessary.
Help me please, I am trying to work out how to do it now, but it took me the better part of a day to open the file ahhhh. Im using windows
I promise to always blame the network from now on, and NOT the programmers ;-)))
Sam
#!E:\Perl\bin
open (LOGFILE, "log.txt" or die "yes its not working again";
$title = <LOGFILE>;
print "Report Title: $title";
for $line (<LOGFILE>) {
print $line;
}
use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host
=> '172.24.100.211'); #here is the router address
$session->login('login', 'cisco');
if ($session->enable(cisco)) {
@output = $session->cmd('show privilege');
print "My privileges: @output\n";
} else {
warn "Cant enable: " . $session->errmsg;
}
my @output = $session->cmd('configure terminal');
my @output = $session->cmd('interface Dialer 101'); #here #is the dialer number
my @output = $session->cmd('No Shutdown');
I am a Cisco administrator that has been chucked headfirst into the world of scripting. So starting yesterday, I have made my first script that works. yahooo. Its below if needed
I need this script to open interface dialers on a cisco router. The script below can open a file, and open a dialer via telnet, but only if I enter the router ip address, and dialer number manually. I need to dynamically (meaning automated, no human input) open any router and its associated dialers that might be in this file. The file is dynamically made, and can be split up if necessary.
Help me please, I am trying to work out how to do it now, but it took me the better part of a day to open the file ahhhh. Im using windows
I promise to always blame the network from now on, and NOT the programmers ;-)))
Sam
#!E:\Perl\bin
open (LOGFILE, "log.txt" or die "yes its not working again";
$title = <LOGFILE>;
print "Report Title: $title";
for $line (<LOGFILE>) {
print $line;
}
use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host
=> '172.24.100.211'); #here is the router address
$session->login('login', 'cisco');
if ($session->enable(cisco)) {
@output = $session->cmd('show privilege');
print "My privileges: @output\n";
} else {
warn "Cant enable: " . $session->errmsg;
}
my @output = $session->cmd('configure terminal');
my @output = $session->cmd('interface Dialer 101'); #here #is the dialer number
my @output = $session->cmd('No Shutdown');