supriyas has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am completely new to perl and need to write a script which will login to a router and execute few commands. Below is my code and I am getting a error as "Can't find @INC Net::SSH::Perl" I have also tried with Net::SSH and getting the same error. I have tried installing it all the ways but failed. Don't even know where I am going wrong. Please help.
#!/usr/bin/perl -w use strict; use lib qw("/path/to/module/"); use Net::SSH::Perl; my $hostname = "hostname"; my $username = "username"; my $password = "password"; my $cmd = shift; my $ssh = Net::SSH::Perl->new("$hostname", debug=>0); $ssh->login("$username","$password"); my ($stdout,$stderr,$exit) = $ssh->cmd("$cmd"); print $stdout;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl script on networks.
by thomas895 (Deacon) on Aug 18, 2014 at 06:11 UTC | |
by supriyas (Initiate) on Aug 18, 2014 at 07:00 UTC | |
by Corion (Patriarch) on Aug 18, 2014 at 07:11 UTC | |
|
Re: Perl script on networks.
by f77coder (Beadle) on Aug 18, 2014 at 06:09 UTC |