Hi All,
Thanks for reply.

I have Perl.pm installed in following path
[EMAIL PROTECTED] scripts]$ ls -l /tmp/Net/SSH/
total 32
-rwxr--r-- 1 cgadgil cgadgil 32724 Aug 13 06:42 Perl.pm
[EMAIL PROTECTED] scripts]$

And perl script I modified as follows
#! /usr/bin/perl;

# perl module to parse the AVMInstall.log file for errors

use lib '/tmp';
use Net::SSH::Perl;
    my $ssh = Net::SSH::Perl->new(avm-qa-cam2.cisco.com);
    $ssh->login(cgadgil, cgadgil);
    my($stdout, $stderr, $exit) = $ssh->cmd(ls);

And now I am getting another error as 
Can't locate Net/SSH/Perl/Packet.pm in @INC (@INC contains: /tmp
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi

Now do I need to download Packet.pm and store in the same location? And
what is the purpose of it.
Please suggest.

Regards
Irfan.
 

-----Original Message-----
From: Rob Dixon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 6:36 PM
To: Perl Beginners
Cc: Irfan J Sayed (isayed)
Subject: Re: Execute the Linux command on remote machine

Irfan J Sayed (isayed) wrote:
>  
> 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

You are getting a lot of similar advice but it doesn't seem to be
getting you anywhere. Do this.

Make sure your library file Perl.pm is installed here

  /tmp/Net/SSH/Perl.pm

then you can write

  use lib '/tmp';
  use Net::SSH::Perl;

Although as Tom said it would be nicer to install it in your home
directory - something like

  /home/isayed/lib/Net/SSH/Perl.pm

in which case you would say

  use lib '/home/isayed/lib';
  use Net::SSH::Perl;

You should be able to get one of these going at least.

Rob



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to