1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/opt/ActivePerl-5.8/bin/perl -w
use Net::Telnet::Cisco;
use strict;
my @dev=();
$dev[0]={'ip'=>"$ip",
'prompt1'=>'/R7204\.TB\>/',
'prompt2'=>'/R7204\.TB\#/',
'username'=>'etwas',
'password'=>'geheimes',
'enable'=>''};
my @pole=();
my $tel=new Net::Telnet::Cisco(Timeout=>10,Prompt=>$dev[0]->{prompt2},Host=>$dev[0]->{ip});
$tel->login(Name=>$dev[0]->{username},Password=>$dev[0]->{password});
$tel->prompt($dev[0]->{prompt2});
$tel->dump_log('logfile.log');
$tel->print("telnet $andereIP /vrf VOICE");
$tel->waitfor('/Username:/');
$tel->print($dev[0]->{username});
$tel->waitfor('/Password:/');
$tel->print($dev[0]->{password});
$tel->waitfor('/MACC\-MFC\#/');
@pole=$tel->cmd('sh running');
$tel->print('exit');
$tel->close;
print "@pole\n";
command timed-out at line 24.
comannd timed-out at line
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
< 0x00000: 08 08 08 08 08 08 08 08 08 20 20 20 20 20 20 20 .........
< 0x00010: 20 08 08 08 08 08 08 08 08 08 61 6c 69 61 73 20 .........alias
< 0x00020: 65 78 65 63 20 63 20 63 6f 6e 66 20 74 65 72 6d exec c conf term
< 0x00030: 0d 0a 61 6c 69 61 73 20 65 78 65 63 20 73 20 73 ..alias exec s s
< 0x00040: 68 20 72 75 6e 0d 0a 61 6c 69 61 73 20 65 78 65 h run..alias exe
< 0x00050: 63 20 77 20 77 72 20 6d 65 0d 0a 61 6c 69 61 73 c w wr me..alias
< 0x00060: 20 65 78 65 63 20 76 20 73 68 20 76 6f 69 63 65 exec v sh voice
< 0x00070: 20 63 61 6c 6c 20 73 75 6d 6d 61 72 79 0d 0a 21 call summary..!
< 0x00080: 0d 0a 6c 69 6e 65 20 63 6f 6e 20 30 0d 0a 20 6c ..line con 0.. l
< 0x00090: 6f 67 67 69 6e 67 20 73 79 6e 63 68 72 6f 6e 6f ogging synchrono
< 0x000a0: 75 73 0d 0a 6c 69 6e 65 20 61 75 78 20 30 0d 0a us..line aux 0..
< 0x000b0: 6c 69 6e 65 20 76 74 79 20 30 20 34 0d 0a 20 70 line vty 0 4.. p
< 0x000c0: 61 73 73 77 6f 72 64 20 37 20 30 36 31 35 31 41 assword 7 06151A
< 0x000d0: 33 31 34 39 35 43 35 42 0d 0a 20 6c 6f 67 69 6e 31495C5B.. login
< 0x000e0: 20 6c 6f 63 61 6c 0d 0a 6c 69 6e 65 20 76 74 79 local..line vty
< 0x000f0: 20 35 20 31 35 0d 0a 20 6c 6f 67 69 6e 20 6c 6f 5 15.. login lo
< 0x00100: 63 61 6c 0d 0a 21 0d 0a 73 63 68 65 64 75 6c 65 cal..!..schedule
< 0x00110: 72 20 61 6c 6c 6f 63 61 74 65 20 32 30 30 30 30 r allocate 20000
< 0x00120: 20 31 30 30 30 0d 0a 65 6e 64 0d 0a 0d 0a 4d 41 1000..end....MA
< 0x00130: 43 43 2d 4d 46 43 23 CC-MFC#
command timed-out at line
Quotepole=$tel->cmd('sh running');
command timed-out at line