Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Using Net::SSH2::Cisco

by salva (Canon)
on Dec 17, 2015 at 18:34 UTC ( [id://1150636]=note: print w/replies, xml ) Need Help??


in reply to Using Net::SSH2::Cisco

Also, ensure you have the latest versions of libssh2 and Net::SSH2 installed as several important bugs were fixed there.

Replies are listed 'Best First'.
Re^2: Using Net::SSH2::Cisco
by mroe1234 (Initiate) on Dec 17, 2015 at 19:29 UTC

    Good thought. Rather than using the debian packaged versions, I installed the following versions:

    libnet-ssh2-perl 0.56-1 libssh2-1:amd64 1.5.0-2 libssh2-1-dev:amd64 1.5.0-2

    libssh2 I pulled from debian unstable and did an SSB to jessie, libnet-ssh2-perl I pulled from CPAN and made a deb out of it. No change in the behavior.

    I added the following code to play with the timeouts as VinsWorldcom suggested with no change in behavior:

    if ($model =~ /$nexus/) { my $output; $sok->timeout(10); @cmdoutput = $sok->cmd( String => "copy startup-config tftp://$tftp_server/$con +figfile vrf $vrf\n\n\n", Errmode => "return", ); print Dumper @cmdoutput; if ($sok->errmsg){ ($error) = $sok->errmsg; print "Nexus IP: $host: Command failed reason: $error. Trying ag +ain...\n" ; $sok->timeout(10); @cmdoutput = $sok->cmd( String => "copy startup-config tftp://$tftp_server/$c +onfigfile vrf management\n\n\n", Errmode => "return", ); $sok->waitfor ( String => '#', Timeout => '5', Waitfor_clear => '1', ); print Dumper @cmdoutput; print "Nexus IP: $host: Command failed reason: $error\n" ; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1150636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found