Does not return all the resultat [Fermé]

Signaler
Messages postés
69
Date d'inscription
jeudi 4 septembre 2014
Statut
Membre
Dernière intervention
18 mars 2016
-
Good Evening,
I made a script that connects to a switch and recovered his configuration, my problem is that the script does not return all the setup, just a tip,help please and thanks for advance .

#!/usr/bin/perl 
use strict; 
use warnings; 
  
use Net::SSH::Expect; 
  
my $ssh = Net::SSH::Expect->new( 
  host     => '192.63.5.4', 
  password => 'user', 
  user     => 'admin', 
  raw_pty  => 1 
); 
  
my $enable_passwd = "user"; 
my $login_output  = $ssh->login(); 
  
$ssh->send("enable"); 
$ssh->waitfor( 'password:\s*\z', 1 ) or die "prompt 'password' not found after 1 second"; 
$ssh->send($enable_passwd); 
$ssh->exec("term pager 0");
$ssh->exec("terminal length 0"); 
my ($ls,$err) =$ssh->exec("show vlan");
print "$ls\n"; 
$ssh->close();