Re: scp_put failing when there are too many files

2015-12-29 Thread Salvador Fandino
On 12/11/2015 06:55 PM, Shlomi Fish wrote: Hi all, On Fri, 11 Dec 2015 11:07:54 -0500 Shawn H Corey wrote: On Fri, 11 Dec 2015 16:28:39 +0100 Ori Raz wrote: Hi, Did anyone encounter the scenario where scp_put is failing (too many arguments) when the directory contains too many files? We ha

Re: Net::Openssh not fetching data

2012-12-17 Thread Salvador Fandino
gt; "/tmp/cmd-output"}, $cmd) or die "ssh command failed: " . $ssh->error; Using capture in list context just reads all the data into memory, splits it into lines an returns them, it is probably the most memory consuming approach. rgds, Rajeev

Re: Net::Openssh not fetching data

2012-12-17 Thread Salvador Fandino
On 12/17/2012 05:21 PM, Rajeev Prasad wrote: the following is _i think_ timing out. when it is run from within my script ( @cmdresult, $cmderr ) = $ssh->capture($CMD); where $CMD is: egrep "data_to_grep" *.data_file.txt the output is about 300Mb of data. further, the command when run on

Re: expect.pm not recognising match string

2012-09-07 Thread Salvador Fandino
On 09/07/2012 12:54 AM, Rajeev Prasad wrote: no because first i have to sudo to some other ID and then run commands. You should be able to call every command through 'sudo', something like this: $ssh->capture('sudo', @sudo_opts, @cmd1); $ssh->capture('sudo', @sudo_opts, @cmd2); Ther

Re: hash of arrays sorting

2012-08-23 Thread Salvador Fandino
> IIRC, a long time ago I send you a patch for Sort::Maker benchmarking > script incorporating Sort::Key variants that showed how faster my module > can be. I would try to find it and send it to you again. Well, I have been unable to find it... but I have redone it :-) Attached are the patch tha

Re: hash of arrays sorting

2012-08-23 Thread Salvador Fandino
On 08/23/2012 09:10 AM, Uri Guttman wrote: > On 08/23/2012 02:54 AM, Salvador Fandino wrote: > >>> >>> It's a pity Sort::Maker not in Debian >> >> There is also Sort::Key, available in Debian testing and unstable, and >> which is usually faster t

Re: hash of arrays sorting

2012-08-22 Thread Salvador Fandino
On 08/22/2012 10:34 PM, Eduardo wrote: > On 22/08/12 03:49, Uri Guttman wrote: >> On 08/21/2012 08:29 PM, Eduardo wrote: >>> how would you do with Sort::Maker? >> i don't have time to show an example now but it is much cleaner >> looking. all you need to do is code up how you extract each key from

Re: Implementation of sFTP using Perl

2012-01-30 Thread Salvador Fandino
On 01/12/2012 06:16 PM, Wagner, David --- Sr Programmer Analyst --- CFS wrote: > > I need to change from FTP to sFTP and want to use a Perl > implementation verses using sFTP application bound within Perl scripts. > I will be running from Linux and pulling data either from MVS or > Win

Re: Net::Openssh and sudo?

2012-01-30 Thread Salvador Fandino
On 01/29/2012 07:53 AM, Rajeev Prasad wrote: Hi Salva, thx, but the installed sudo version does not have -S option. so i am not sure how will i then pass the password Yes, with older versions of sudo, using Expect is probably the best way. That may also work: my $output = $ssh->captur

Re: is this ssh happenign in parallel?

2011-11-14 Thread salvador fandino
On Mon, Nov 14, 2011 at 12:43 AM, Rajeev Prasad wrote: > Salva, > > can you explain how to use variable expansion in your written module > Net::Openssh and Net::Openssh::Parallel ? I want to be able to specify > userid and password for the parallel ssh sessions using > Net::Openssh::Parallel ...

Re: how to use Net::OpenSSH::Parallel

2011-09-19 Thread salvador fandino
On Sat, Sep 17, 2011 at 6:15 PM, Rajeev Prasad wrote: > Hi Salva, > Thx for responding. I need to SSH into several nodes and run some commands > there and capture the modified output to a file on local node from where the > script is run. The easiest way to do that with Net::OpenSSH::Parallel is

Re: Using perl to automate add user on linux/freebsd systems

2011-03-17 Thread Salvador Fandino
On 03/14/2011 07:59 PM, siegfr...@heintze.com wrote: Does anyone know the perl API (presumably on CPAN) for useradd/userdel/usermod to automate the manipulation of users on FreeBSD systems? On Linux systems? thanks, Siegfried "adduser" is actually a Perl program that uses "useradd" under the h

Re: How can I open a remote ssh session with perl

2010-09-01 Thread Salvador Fandino
On 08/27/2010 05:47 AM, S Pratap Singh wrote: > Hello Peter , > > Did you try executing command "top -cd2", "iostat 1", vmstat 1 10" etc ? Did > you get the output of those command ? I am not getting the output of these > commands rest works fine for me. use Net::OpenSSH; my $ssh = Net::Open

Re: How can I open a remote ssh session with perl

2010-09-01 Thread Salvador Fandino
On 08/25/2010 07:51 PM, C.DeRykus wrote: > On Aug 24, 12:28 pm, frase...@gmail.com (Brian Fraser) wrote: >> On Tue, Aug 24, 2010 at 11:08 AM, Peter Scott wrote: >>> CPAN: Net::SSH::Perl . >> >> I had a similar issue not too long ago; Spent a couple of days attempting to >> get Net::SSH::Perl to co

Re: piping input to ssh session

2010-07-27 Thread Salvador Fandino
On 07/23/2010 09:59 PM, Noah wrote: > Hi there, > > I am trying to input a bunch of commands to an ssh session. One way to > do it is to create a file and pipe it. Something like 'cat | > ssh admin@' would work. > > But what If I just want to send a bunch of lines of text without > creating a

Re: Fork ssh

2010-06-18 Thread Salvador Fandino
On 06/17/2010 04:34 AM, Unknown User wrote: This works pretty well, but Since There is More than One Way to DO it, i wonder if anyone has another version that does not use fork? There is Net::OpenSSH::Parallel. - Salva -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: Math::GMP

2010-02-25 Thread Salvador Fandino
On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error. Here's the transcript. May someone shed some light? Net::SSH::

Re: Config::Properties - Change property value

2010-02-19 Thread Salvador Fandino
== What I am trying to do is to read the "download.properites" file first and then change the value for "currentDate" and then store it back to property file. Most of this works. But while writing it back to the property file it appends all the properties at the

Re: Net-SSH-Perl with Cisco

2010-02-19 Thread Salvador Fandino
Paul wrote: Hello All, I've been trying to write a Windows script that will log into a Cisco ASA using SSH2, run an escalated command, and return the results but, I've run into a wall. When trying to initiate the connection with the ASA it always fails in the same spot. Here is the debug from t

Re: perl expect script to login to multiple machines

2010-01-05 Thread Salvador Fandino
perl_haxor 123 wrote: Hi All, I'm new to perl and facing a problem I'm using a perl expect script to login to multiple machines (having same username and password) and execute the date command, initially i tested on one machine, it worked fine...but when i use a foreac