Hi all,
I hope someone can help me with this. I am writing a little script to do one task on about 500 switches (cat1900 enterprise edition software).
Using Win2000 machine running the scripts from a dos-box. Using activestate Active Perl 5.8.
Here is the script sofar:
The above works because I can see it in the Dump_Log. It (although not quite readable) shows that it does what I wanted the script to do.
In the Output_Log I see what commands have been given. (the print and cmd lines)
I do not see anything in the Input_Log and I would love to see what happens on the screen.
My questions are..
1. Why am I not seeing anything in the Input_Log?
2. Is it possible to show what happens during the script on the screen so I can see it happen?
Thanks in advance,
InDenial
I hope someone can help me with this. I am writing a little script to do one task on about 500 switches (cat1900 enterprise edition software).
Using Win2000 machine running the scripts from a dos-box. Using activestate Active Perl 5.8.
Here is the script sofar:
Code:
use strict;
use Net::Telnet;
my $telnet = new Net::Telnet ( Timeout=>5,
Binmode=>1,
Output_log=>'./fout',
Input_log=>'./fin',
Option_log=>'./option',
Dump_Log=>'./dump',
Errmode=>'die',
Prompt=>'/switchname#/');
#Open telnet connection
$telnet->open('10.0.0.1');
$telnet->waitfor('/Press any key to continue\./i');
$telnet->print('');
#Login part 1 (menu)
$telnet->print('K');
$telnet->waitfor('/switchname>/i');
#Login part 2 (enable mode)
$telnet->print('en');
$telnet->waitfor('/Enter password:/i');
$telnet->print('password');
#Execute some commands and print them on screen (?)
my @lines = $telnet->cmd('show vtp');
print @lines;
$telnet->print('exit');
exit;
The above works because I can see it in the Dump_Log. It (although not quite readable) shows that it does what I wanted the script to do.
In the Output_Log I see what commands have been given. (the print and cmd lines)
I do not see anything in the Input_Log and I would love to see what happens on the screen.
My questions are..
1. Why am I not seeing anything in the Input_Log?
2. Is it possible to show what happens during the script on the screen so I can see it happen?
Thanks in advance,
InDenial