josh803316 has asked for the wisdom of the Perl Monks concerning the following question:

I'm logging into an IOS device with Net::Appliance::Session and then I'm executing a command that takes longer than 30 seconds to execute (an upgrade). I notice that I consistently get the following error:
Timeout, EOF or other failure waiting for command response at ./net_appliance_session.pl
#!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Net::Appliance::Session; my $ios_device_ip = '10.1.1.1'; my $ios_username = 'user'; my $ios_password = 'pass'; my $ios_enable_password = 'enable_pass'; $|=1; my $session_obj = Net::Appliance::Session->new( Host => $ios_device_ip, Transport => 'Telnet', Dump_log => 'dump.log', Input_log => 'input.log', Output_log => 'output.log' ); # give verbose output whilst we run this script $session_obj->input_log(*STDOUT); $session_obj->connect(Name => $ios_username, Password => $ios_password +, Timeout => 1000); $session_obj->do_paging(0); $session_obj->begin_privileged($ios_enable_password); $session_obj->cmd('upgrade all ftp://anonymous@host/buildname');
So my question is, how can I change the command (not login) timeout setting? I know that Net::Telnet and openssh are used by Net::Appliance::Session but I'm not sure how to access the configuration options underneath.

Replies are listed 'Best First'.
Re: Command Timeout for Net::Appliance::Session
by ahmad (Hermit) on Jul 21, 2010 at 21:43 UTC

    You can pass it to the cmd method 'Timeout' => xxx, 'command'

      Thank you so much for the guidance. I was able to get it working with the options like this:
      $session->cmd( Timeout => 1000, String => 'String');
        How are you making the input_log work?
        my $s = Net::Appliance::Session->new({ personality => 'ios', transport => 'SSH', Input_log => 'input.log', Timeout => 15, host => $ip, });
        I get nothing from the log