On Aug 13, 2008, at 4:25 AM, Irfan J Sayed (isayed) wrote:
Hi All,
I want to execute one command on remote Linux machine.
Following is the perl code.
#! /usr/bin/perl;
# perl module to parse the Install.log file for errors
use lib "/tmp/";
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new(avm-qa-cam2.net.com);
$ssh->login(cgadgil, cgadgil);
my($stdout, $stderr, $exit) = $ssh->cmd(ls);
Actually i want to parse the log file for errors which is on the
remote
machine. so i want to execute some commands on remote machine. for
example ls
I have copied the Perl.pm in the /tmp folder but still i am getting
@INC
error.
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /tmp/
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
Please suggest.
Regards
Irfan.
Irfan, I think the use of /tmp is ok, or using your home directory.
But
use lib "/home/cgadgil/usr/net/ssh/perl";
use Net::SSH::Perl;
should be
use lib "/home/cgadgil/usr/";
use Net::SSH::Perl;
and your module, Perl.pm, then needs to be placed in
"/home/cgadgil/usr/Net/SSH/".
If you used /tmp, then
use lib "/tmp";
use Net::SSH::Perl;
and Perl.pm would need to be placed in
/tmp/Net/SSH
And case matters...
tom
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/