|
I'm working on a script to SSH to an IOS device using N::A::S v2.110090. It issues the command 'show mac-address-table dynamic'. On particularly large switches it takes a very long time to get the response back. Using the default timeout nets me about 10s (+3s to startup and login) before the command times out:
my $s = new Net::Appliance::Session ( Host => 'XXXXXX' );
$s->connect( Name => 'XXX', Password => 'XXX' );
printf "Timeout is %d\n", $s->timeout();
my @r = $s->cmd( 'show mac-address-table dynamic' );
Command output:
> time ./timeout.pl
Timeout, EOF or other failure waiting for command response at ./timeout.pl line 13
Timeout is 10
./timeout.pl 8.56s user 0.04s system 63% cpu 13.440 total
Adjusting the timeout to 120 seconds does not net me 120 seconds of wait time like I believe it should:
my $s = new Net::Appliance::Session ( Host => 'XXXXXX', Timeout => 120 );
Command output:
> time ./timeout.pl
Timeout, EOF or other failure waiting for command response at ./timeout.pl line 13
Timeout is 120
./timeout.pl 47.51s user 0.06s system 89% cpu 53.268 total
Changing the timeout to 240 yeilds the same result as 120. Changing the timeout via cmd() gives me the same result
$s->cmd( String => 'show mac-address-table dynamic', Timeout => 120 );
Command output:
> time ./timeout.pl
Timeout is 10
Timeout, EOF or other failure waiting for command response at ./timeout.pl line 13
./timeout.pl 46.53s user 0.07s system 89% cpu 51.875 total
Has anyone else had luck with changing the timeout? Am I missing something obvious? I hope so....
|