ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 20)
Brought to you by:
dbrobins
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(15) |
Mar
(13) |
Apr
(8) |
May
(5) |
Jun
(21) |
Jul
(4) |
Aug
(9) |
Sep
(11) |
Oct
(14) |
Nov
(15) |
Dec
(24) |
2005 |
Jan
(10) |
Feb
(20) |
Mar
(16) |
Apr
(10) |
May
(12) |
Jun
(16) |
Jul
(18) |
Aug
(21) |
Sep
(11) |
Oct
(19) |
Nov
(16) |
Dec
(9) |
2006 |
Jan
(17) |
Feb
(32) |
Mar
(60) |
Apr
(21) |
May
(24) |
Jun
(1) |
Jul
(6) |
Aug
(18) |
Sep
(4) |
Oct
(9) |
Nov
(31) |
Dec
(10) |
2007 |
Jan
(8) |
Feb
(11) |
Mar
(3) |
Apr
(7) |
May
(4) |
Jun
(6) |
Jul
(7) |
Aug
(3) |
Sep
(2) |
Oct
(5) |
Nov
(5) |
Dec
(5) |
2008 |
Jan
(12) |
Feb
(5) |
Mar
(7) |
Apr
(4) |
May
(37) |
Jun
(9) |
Jul
(24) |
Aug
(5) |
Sep
(2) |
Oct
(7) |
Nov
(6) |
Dec
(7) |
2009 |
Jan
(18) |
Feb
(9) |
Mar
(14) |
Apr
(14) |
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(6) |
Sep
(4) |
Oct
(12) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
(4) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
(5) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(8) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(9) |
Dec
(7) |
2012 |
Jan
(1) |
Feb
(19) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(6) |
Dec
|
2014 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Morgan S. <mo...@du...> - 2006-05-31 22:16:38
|
I have a couple questions about the handling of known_hosts2. I know that the location of known_hosts2 file is pretty standard, but is there an option to specify where the known_hosts2 file resides? Now for something different. I've been having difficulties getting scripts to work well with the contents of known_hosts2 as created by Net::SSH::Perl in non-interactive mode on a machine with an empty known_hosts2 file. What I'm finding is that the first time I connect to a host it's host key (ssh-dss) is added to known_hosts2. Even after installing Crypt::RSA gand clearing the known_hosts2 file, Net::SSH::Perl still puts ssh-dss entries into the known_hosts2 file. Not so great. It seems as though ssh-dss is an unsupported key type which is caught in an eval statement. If I use ssh to login to the remote host then an ssh-rsa host key is added to known_hosts2 by the ssh program. Hosts.pm likes ssh-rsa entries :-) I know that ssh-dss entries are default, but if they aren't supported why are they still added to the known_hosts2 file even though Crypt::RSA is installed? I can see how dss may be prefered over rsa because patents. Is there a way to enable support for dss? Is there a module I might not have installed? I suppose I could specify that as an option: my $ssh =3D Net::SSH::Perl->new($host, options =3D> ["HostKeyAlgorithms ssh-rsa,ssh-dss"]); to enable the behavior I'm looking for. It feels like I'm missing something though, like there's a better way to do it. Suggestions? --=20 Morgan Smith Dutro Company 675 North 600 West Logan, UT 84321 (435) 752-3921 ext.146 (435) 512-3374 mo...@du... |
From: David R. <dbr...@cp...> - 2006-05-24 06:02:38
|
On Tuesday May 23, 2006 22:08, apentony wrote: > I'm trying to write a very simple perl ssh program to telnet to a Cisco > router on my home network which only supports SSH version 1 which I cant > upgrade also I only have Windows XP ... > C:\perl\eg>perl ssh.pl > > Can't locate object method "blocking" via package "IO::Handle" at > C:/perl/lib/Net/SSH/Perl.pm line 212, <GEN0> line 1. That's fixed in the latest version of Net::SSH::Perl (1.30). -- Dave Isa. 40:31 |
From: apentony <ape...@op...> - 2006-05-24 05:08:21
|
Hi I'm trying to write a very simple perl ssh program to telnet to a Cisco router on my home network which only supports SSH version 1 which I cant upgrade also I only have Windows XP I know this script is far too simple for most of you expert list users however I have to start some where I've trolled through the previous Archives and get the feeling that the SSH win32's a bit flaky, has anybody got it to work or should I just give up on it I've tried a couple of variations of SSH1.LIB with no success is there a new one out recently I've kept the script ad simple as possible until I get rid of the error message use Net::SSH::Perl::SSH1; $host=('192.168.0.12'); print ($host); my $ssh = Net::SSH::Perl->new($host, protocol => 1); print ($ssh); C:\perl\eg>perl ssh.pl Can't locate object method "blocking" via package "IO::Handle" at C:/perl/lib/Net/SSH/Perl.pm line 212, <GEN0> line 1. 192.168.0.12 Network Consultant CCIE 2846 Off the keyboard..to the switch..bouncing off the proxy server..though the firewall..past the Multi function router..nothin but net! |
From: Padma M. <pad...@ya...> - 2006-05-22 16:10:14
|
Hi I am getting the following error while using Net::SFTP csuitedbbkup: Reading configuration data /home/pmadireddy/.ssh/config csuitedbbkup: Reading configuration data /etc/ssh_config csuitedbbkup: Connecting to csuitedbbkup, port 22. csuitedbbkup: Remote version string: SSH-1.99-OpenSSH_4.2 csuitedbbkup: Remote protocol version 1.99, remote software version OpenSSH_4.2 csuitedbbkup: Net::SSH::Perl Version 1.30, protocol version 2.0. csuitedbbkup: No compat match: OpenSSH_4.2. csuitedbbkup: Connection established. csuitedbbkup: Sent key-exchange init (KEXINIT), wait response. csuitedbbkup: Algorithms, c->s: 3des-cbc hmac-sha1 none csuitedbbkup: Algorithms, s->c: 3des-cbc hmac-sha1 none csuitedbbkup: Entering Diffie-Hellman Group 1 key exchange. csuitedbbkup: Sent DH public key, waiting for reply. csuitedbbkup: Received host key, type 'ssh-dss'. csuitedbbkup: Permanently added 'csuitedbbkup' to the list of known hosts. csuitedbbkup: Computing shared secret key. csuitedbbkup: Verifying server signature. csuitedbbkup: Waiting for NEWKEYS message. csuitedbbkup: Enabling incoming encryption/MAC/compression. csuitedbbkup: Send NEWKEYS, enable outgoing encryption/MAC/compression. csuitedbbkup: Sending request for user-authentication service. Broken Pipe pmadireddy[Oracle 8.1.7] --------------------------------- Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. |
From: Matthew J. S. <vag...@ya...> - 2006-05-20 19:27:38
|
input must be 8 bytes long... I usually solve that by using encode. use Encode; ... Encode::from_to($cmd,'utf8','iso-8859-1'); my($out, $err, $exit) = $ssh->cmd("ls", "-l") ... --- Tuan-DNS1 <ta...@vn...> wrote: > Hi, I am working in VietNam Network Information > Center (VNNIC). I setup my Looking Glass Server , > with "telnet method access" everythings is ok, I > received information from my router.But with " ssh > method access" , my Web logs server have mistakes : > > > [Thu May 18 16:45:05 2006] [error] [client > 203.119.9.89] input must be 8 > bytes long at > /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/Crypt/DES.pm > line > 57., referer: http://lg.vnnic.net.vn/ > > > When I "debug ip ssh" on the router ( my router : > c2600, images: > "flash:c2600-entservicesk9-mz.123-14.T7.bin" ) > It have mistakes : > 4w3d: %SEC-6-IPACCESSLOGP: list 101 permitted tcp > 203.119.10.132(32805) -> > 0.0.0.0(22), 1 packet > 4w3d: SSH1: sent protocol version id > SSH-1.5-Cisco-1.25 > 4w3d: SSH1: protocol version id is - SSH-1.5-1.30 > 4w3d: %SSH-5-SSH_SESSION: SSH Session request from > 203.119.10.132 (tty = 1) > using crypto cipher '3DES' Succeeded > 4w3d: %SSH-5-SSH_USERAUTH: User '' authentication > for SSH Session from > 203.119.10.132 (tty = 1) using crypto cipher '3DES' > Failed > 4w3d: %SSH-5-SSH_CLOSE: SSH Session from > 203.119.10.132 (tty = 1) for user > '' using crypto cipher '3DES' closed > 4w3d: SSH1: Session disconnected - error 0x07 > > I don't know the syntax in file "lg.conf" for ssh > method accesss. > In the "lg.conf" I configured : > For telnet session is : " <Router > Name="ROUTER-CUCTANSO"> > > <URL>telnet://tuan:password@192.168.10.9</URL> > </Router> > What is the ssh session configure? Can you help me > slove my proplem ? > Thanks ! > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Tuan-DNS1 <ta...@vn...> - 2006-05-20 11:51:11
|
Hi, I am working in VietNam Network Information Center (VNNIC). I setup = my Looking Glass Server , with "telnet method access" everythings is ok, = I received information from my router.But with " ssh method access" , my = Web logs server have mistakes : [Thu May 18 16:45:05 2006] [error] [client 203.119.9.89] input must be 8 = bytes long at=20 /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/Crypt/DES.pm = line=20 57., referer: http://lg.vnnic.net.vn/ When I "debug ip ssh" on the router ( my router : c2600, images:=20 "flash:c2600-entservicesk9-mz.123-14.T7.bin" ) It have mistakes : 4w3d: %SEC-6-IPACCESSLOGP: list 101 permitted tcp 203.119.10.132(32805) = ->=20 0.0.0.0(22), 1 packet 4w3d: SSH1: sent protocol version id SSH-1.5-Cisco-1.25 4w3d: SSH1: protocol version id is - SSH-1.5-1.30 4w3d: %SSH-5-SSH_SESSION: SSH Session request from 203.119.10.132 (tty = =3D 1)=20 using crypto cipher '3DES' Succeeded 4w3d: %SSH-5-SSH_USERAUTH: User '' authentication for SSH Session from=20 203.119.10.132 (tty =3D 1) using crypto cipher '3DES' Failed 4w3d: %SSH-5-SSH_CLOSE: SSH Session from 203.119.10.132 (tty =3D 1) for = user=20 '' using crypto cipher '3DES' closed 4w3d: SSH1: Session disconnected - error 0x07 I don't know the syntax in file "lg.conf" for ssh method accesss. In the "lg.conf" I configured : For telnet session is : " <Router Name=3D"ROUTER-CUCTANSO"> = <URL>telnet://tuan:password@192.168.10.9</URL> </Router> What is the ssh session configure? Can you help me slove my proplem ? Thanks ! |
From: David R. <dbr...@cp...> - 2006-05-17 02:59:54
|
On Friday May 12, 2006 22:01, Stephen Clouse wrote: > Two minor fixes to scp_get. I actually did these quite a while ago, > but they've been rolled into our local RPM repository and I forgot > about passing them along: > > 1. $stat{mode} gets anded with 0x777, which doesn't make any sense. > This was causing us some weird permission problems on retrieved files. > I think the intended number here is 0777 (octal). > > 2. The output handle for scp_get should probably have O_TRUNC set, > because I think this is what people expect. We found this from > getting errors about junk data at the end of tar files we were pulling > down, because we maintain a local cache and sometimes pull down the > same file multiple times and overwrite the local file. If the updated > file was smaller than the previous, the difference would remain at the > end of the new local file. Thanks again; applied to 0.09 candidate. -- Dave Isa. 40:31 |
From: Eric L. <net...@er...> - 2006-05-17 00:42:22
|
> Behalf Of Matthew J. Salerno > Did you read the error message or just post it? > > "exec is not a valid Net::SSH2 macro at ./ssh2.pl line 44" > > Read the docs. There is no reference to exec. Your e-mail > is not even asking a question! > > http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm > > Look at the given example. Matthew, The actual Link should be http://search.cpan.org/~dbrobins/Net-SSH2-0.08/lib/Net/SSH2.pm since Mark is trying to work with Net::SSH2, not Net::SSH::Perl. Mark is trying to use the new module. Mark, The problem with your script is that you are calling execute on the ssh2 object and not the channel object. Changing this: my $chan = $ssh2->channel(); $ssh2->exec('sh ver'); To this: my $chan = $ssh2->channel(); $chan->exec('sh ver'); Should take care of the problem with the invalid macro. Hope this helps. |
From: Stephen C. <ste...@gm...> - 2006-05-16 08:40:24
|
T24gNS8xNS8wNiwgTWFyayBGdW5rIDxtZnVua0B0cmluaXR5c29sLm5ldD4gd3JvdGU6Cj4KPiAg ICAkc3NoMi0+ZXhlYygnc2ggdmVyJyk7Cj4KPiBleGVjIGlzIG5vdCBhIHZhbGlkIE5ldDo6U1NI MiBtYWNybyBhdCAuL3NzaDIucGwgbGluZSA0NAo+CiRjaGFuLT5leGVjKCdzaCB2ZXInKTsKCmV4 ZWMgaXMgYSBDaGFubmVsIG1ldGhvZC4KCi0tIApTdGVwaGVuIENsb3VzZSA8c3RlcGhlbmNsb3Vz ZUBnbWFpbC5jb20+Cg== |
From: Matthew J. S. <vag...@ya...> - 2006-05-15 20:30:55
|
--- Mark Funk <mf...@tr...> wrote: > Did you read my subject? Or just post a response? > > I changed the line to this: > sub ssh2_cisco { > my $ssh2 = Net::SSH2->new(); > $ssh2->connect("$host1") or warn "Can't open > connection to $host1\n"; > $ssh2->auth_password($user1, $pass1); > my $chan = $ssh2->channel(); > # using exec to execute a command > $chan->exec('sh ver'); > <---------------------------------- > print "EXEC : $_" while <$chan>; > > # don't forget to close since you can do only 1 > exec > $chan->close; > # writing to a channel > # a new channel, remember the last one is closed > my $chan=$ssh2->channel(); > $chan->shell(); > print $chan "sh ver\n"; > > > root@tcpsyslog:/usr/local/scripts# > root@tcpsyslog:/usr/local/scripts# > root@tcpsyslog:/usr/local/scripts# > root@tcpsyslog:/usr/local/scripts# ./ssh2.pl Can't > call method "exec" on an > undefined value at ./ssh2.pl line 44. > root@tcpsyslog:/usr/local/scripts# > > But I still get an error............ > > > >Read the docs. There is no reference to exec. > Your > >e-mail is not even asking a question! > > >http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm > > >Look at the given example. > > > Also, the doc reference you replied back with is for > SSH not SSH2! > > > > David M. Funk > President/CEO > � > > > -----Original Message----- > From: Matthew J. Salerno > [mailto:vag...@ya...] > Sent: Monday, May 15, 2006 3:27 PM > To: Mark Funk; > ssh...@li... > Subject: Re: [Ssh-sftp-perl-users] Anyone have an > example of SSH2 to Cisco? > > --- Mark Funk <mf...@tr...> wrote: > > > sub ssh2_cisco { > > > > my $ssh2 = Net::SSH2->new(); > > > > $ssh2->connect("$host1") or warn "Can't open > > connection to $host1\n"; > > > > $ssh2->auth_password($user1, $pass1); > > > > my $chan = $ssh2->channel(); > > > > #$chan->pty('terminal'); > > > > $ssh2->exec('sh ver'); > > > > } > > > > > > > > root@tcpsyslog:/usr/local/scripts# ./ssh2.pl > > > > exec is not a valid Net::SSH2 macro at ./ssh2.pl > > line 44 > > > > root@tcpsyslog:/usr/local/scripts# > > > > > > > > > > > > Thanks, > > Did you read the error message or just post it? > > "exec is not a valid Net::SSH2 macro at ./ssh2.pl > line > 44" > > Read the docs. There is no reference to exec. Your > e-mail is not even asking a question! > > http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm > > Look at the given example. > > __________________________________________________ I have to admit, I just skimmed the subject and read the body, which is where most people post their questions. I would recommend looking at the source code and mailing list archives. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Mark F. <mf...@tr...> - 2006-05-15 19:40:10
|
Did you read my subject? Or just post a response? I changed the line to this: sub ssh2_cisco { my $ssh2 =3D Net::SSH2->new(); $ssh2->connect("$host1") or warn "Can't open connection to $host1\n"; $ssh2->auth_password($user1, $pass1); my $chan =3D $ssh2->channel(); # using exec to execute a command $chan->exec('sh ver'); = <---------------------------------- print "EXEC : $_" while <$chan>; # don't forget to close since you can do only 1 exec $chan->close; # writing to a channel # a new channel, remember the last one is closed my $chan=3D$ssh2->channel(); $chan->shell(); print $chan "sh ver\n"; root@tcpsyslog:/usr/local/scripts# root@tcpsyslog:/usr/local/scripts# root@tcpsyslog:/usr/local/scripts# root@tcpsyslog:/usr/local/scripts# ./ssh2.pl Can't call method "exec" on = an undefined value at ./ssh2.pl line 44. root@tcpsyslog:/usr/local/scripts# But I still get an error............ >Read the docs. There is no reference to exec. Your >e-mail is not even asking a question! >http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm >Look at the given example. Also, the doc reference you replied back with is for SSH not SSH2! David M. Funk President/CEO =A0 Tivoli Certified Enterprise Consultant Specializing in Network and Systems Management Solutions Trinity Solutions=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 604 Cassandra Dr.=A0=A0=A0=A0=A0=A0=A0=20 Cranberry Twp., PA 16066 =A0 Phone: = 724-316-0721=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 Fax:=A0=A0=A0 724-772-7889=20 email: mf...@tr... http://www.trinitysol.net -----Original Message----- From: Matthew J. Salerno [mailto:vag...@ya...]=20 Sent: Monday, May 15, 2006 3:27 PM To: Mark Funk; ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Anyone have an example of SSH2 to = Cisco? --- Mark Funk <mf...@tr...> wrote: > sub ssh2_cisco { >=20 > my $ssh2 =3D Net::SSH2->new(); >=20 > $ssh2->connect("$host1") or warn "Can't open > connection to $host1\n"; >=20 > $ssh2->auth_password($user1, $pass1); >=20 > my $chan =3D $ssh2->channel(); >=20 > #$chan->pty('terminal'); >=20 > $ssh2->exec('sh ver'); >=20 > } >=20 > =20 >=20 > root@tcpsyslog:/usr/local/scripts# ./ssh2.pl >=20 > exec is not a valid Net::SSH2 macro at ./ssh2.pl > line 44 >=20 > root@tcpsyslog:/usr/local/scripts# >=20 > =20 >=20 > =20 >=20 > Thanks, Did you read the error message or just post it? "exec is not a valid Net::SSH2 macro at ./ssh2.pl line 44" Read the docs. There is no reference to exec. Your e-mail is not even asking a question! http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm Look at the given example. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around=20 http://mail.yahoo.com=20 |
From: Matthew J. S. <vag...@ya...> - 2006-05-15 19:27:21
|
--- Mark Funk <mf...@tr...> wrote: > sub ssh2_cisco { > > my $ssh2 = Net::SSH2->new(); > > $ssh2->connect("$host1") or warn "Can't open > connection to $host1\n"; > > $ssh2->auth_password($user1, $pass1); > > my $chan = $ssh2->channel(); > > #$chan->pty('terminal'); > > $ssh2->exec('sh ver'); > > } > > > > root@tcpsyslog:/usr/local/scripts# ./ssh2.pl > > exec is not a valid Net::SSH2 macro at ./ssh2.pl > line 44 > > root@tcpsyslog:/usr/local/scripts# > > > > > > Thanks, Did you read the error message or just post it? "exec is not a valid Net::SSH2 macro at ./ssh2.pl line 44" Read the docs. There is no reference to exec. Your e-mail is not even asking a question! http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm Look at the given example. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: J <mer...@ya...> - 2006-05-15 17:43:44
|
I have 2 errors i'm receiving using the newest version of Net-SSH. My script runs on a unix env and connects to a windows env, then downloads all the files in that directory then sleeps. Wakes up and repeat. 1. I can only download 99 files at a time. After that the rest of the files in a directory get an error "Unsuccessful getting file" and the error code is -31. I'd like to be able to download all the files instead of just 99. 2. At least once a day the script will not be able to connect and i'll get a -16 error. I tried having it sleep and then retry and every retry still cannot connect. The only way i've found to get around this is when it can't connect and it stops I restart it. Has anyone seen this before or can explain why it's not working? Code Start: #! /usr/local/bin/perl # use Net::SSH2; use strict; umask 0111; my $count; ### Define 'constants' ### my $CONT_FL = 1; my $STOP_FL = 0; my $MSG_FL = 2; my $stopped = 0; my $fatal_error = 0; # Infinite loop so the program doesn't stop unless killed or finds an error. while (1) { $count = 0; # Change local directory to specified destination directory my $local_dir = chdir("/unixdir"); if ($local_dir != 1) { werr_msg("Unable to change local destination directory.", $STOP_FL); } my @test = `rm -f /unixdir/*`; # Setup connection to the web server my $conn = Net::SSH2->new(); eval { $conn->connect("webserver"); }; werr_msg("Unable to connect to. Reason: $@", $STOP_FL) if $@; my $status = $conn->auth_publickey("username", "$ENV{'HOME'}/.ssh/id_rsa.pub", "$ENV{'HOME'}/.ssh/id_rsa"); if ($status) { my $sf = $conn->sftp(); my $directory = $sf->opendir("/temp"); if(!defined($directory)) { werr_msg("Unable to change to source directory.", $STOP_FL); } while (my $readObj = $directory->read) { my $fname = $readObj->{name}; if ($fname ne "." && $fname ne "..") { my $fileo = $sf->open("/temp/$fname"); if(defined($fileo)) { werr_msg("Start transfering file $fname from.", $MSG_FL); $count++; my $fbuf; open(DEST, ">$fname"); my $readSize = $fileo->read($fbuf, 6144); while($readSize != 0) { print DEST $fbuf; $readSize = $fileo->read($fbuf, 6144); } close(DEST); } else { # error in getting the file, skip to the next file werr_msg("Unsuccessful in getting file $fname.", $CONT_FL); } } } } else { print $conn->error . "\n"; werr_msg("Unable to connect to.", $STOP_FL); } $conn->disconnect(); werr_msg("Done transfering $count files from.", $MSG_FL); if ($fatal_error) { werr_msg("Fatal error, cannot continue processing", $STOP_FL); } werr_msg("Done transfering files, sleeping.", $MSG_FL); sleep(60); } exit(0); # ---------------------------------------------------------------------- # Function: werr_msg # Purpose: Writes error/warning messages # Author: L. McMillion, 03-09-99, SRA Corporation # Revised: Hector Caro, 07-01-00, SRA Corporation # Assumptions: Requires continuation or stop flag as argument # # ---------------------------------------------------------------------- sub werr_msg { my($msg, $continue) = @_; my $cur_time = localtime(time()); if ($continue == $CONT_FL) { print "$cur_time: Warning in ", __FILE__, ": ", $msg, "\n"; warn("$cur_time: Warning in ", __FILE__, ": ", $msg, "\n"); } elsif ($continue == $STOP_FL) { print ("\nError in ", __FILE__, ": ", $msg," Check logfile for details.\n\n"); die("$cur_time: Error in ", __FILE__, ": ", $msg, " ($!)\n"); } else { print (STDERR "$cur_time: ", $msg, "\n"); } } Code End |
From: Stephen C. <ste...@gm...> - 2006-05-13 05:01:09
|
VHdvIG1pbm9yIGZpeGVzIHRvIHNjcF9nZXQuICBJIGFjdHVhbGx5IGRpZCB0aGVzZSBxdWl0ZSBh IHdoaWxlIG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cp...> - 2006-05-07 02:23:00
|
On Thursday May 4, 2006 16:32, Stephen Clouse wrote: > This patch fixes the refcount bug. I finally noticed the GV was being > initialized with a refcount of 2, but couldn't figure out why. The > real problem is that sv_magic() is not fond of taking a mortal RV > (which ST(0) is) -- it needs a non-TEMP'd reference that can properly > be converted to a weakref (that is the internal magic that allows Perl > to clean up self-tied handles). Once the sv_magic call is fixed, the > refcount increment on the initial GV creation is no longer necessary, > and the refcounts are then correct. Thanks very much. I've applied your patch and the tests look good, and I think it's important enough to go out as 0.08 even though I haven't collected up any other changes yet. Expect to see it on CPAN shortly. ... > Just as a final note, my daemon has been running for several hours now > with this patch applied and has yet to leak a socket descriptor.... Excellent. Of course, you're credited in the changelog for the fix. -- Dave Isa. 40:31 |
From: Stephen C. <ste...@gm...> - 2006-05-04 23:32:40
|
VGhpcyBwYXRjaCBmaXhlcyB0aGUgcmVmY291bnQgYnVnLiAgSSBmaW5hbGx5IG5vdGljZWQgdGhl IEdWIHdhcyBiZWluZwppbml0aWFsaXplZCB3aXRoIGEgcmVmY291bnQgb2YgMiwgYnV0IGNvdWxk bid0IGZpZ3VyZSBvdXQgd2h5LiAgVGhlCnJlYWwgcHJvYmxlbSBpcyB0aGF0IHN2X21hZ2ljKCkg aXMgbm90IGZvbmQgb2YgdGFraW5nIGEgbW9ydGFsIFJWCih3aGljaCBTVCgwKSBpcykgLS0gaXQg bmVlZHMgYSBub24tVEVNUCdkIHJlZmVyZW5jZSB0aGF0IGNhbiBwcm9wZXJseQpiZSBjb252ZXJ0 ZWQgdG8gYSB3ZWFrcmVmICh0aGF0IGlzIHRoZSBpbnRlcm5hbCBtYWdpYyB0aGF0IGFsbG93cyBQ ZXJsCnRvIGNsZWFuIHVwIHNlbGYtdGllZCBoYW5kbGVzKS4gIE9uY2UgdGhlIHN2X21hZ2ljIGNh bGwgaXMgZml4ZWQsIHRoZQpyZWZjb3VudCBpbmNyZW1lbnQgb24gdGhlIGluaXRpYWwgR1YgY3Jl YXRpb24ga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b3IuLi4uCgotLQpTdGVwaGVuIENsb3VzZSA8c3RlcGhlbmNsb3VzZUBnbWFpbC5jb20+Cg== |
From: David R. <dbr...@cp...> - 2006-05-04 03:29:47
|
On Tuesday May 2, 2006 20:26, Stephen Clouse wrote: > No one has anything toward a fix on this? I spent today taking > another look at it.... > > The object structure is self-referential (the PVIO contains a > reference back to the PVGV): ... > Is this a self-tied filehandle? Aren't those broken in 5.8.x? Maybe > this just needs to be reimplemented. Yes, it is a self-tied filehandle. I thought that was fixed (in perl)? -- Dave Isa. 40:31 |
From: Stephen C. <ste...@gm...> - 2006-05-03 03:34:17
|
Tm8gb25lIGhhcyBhbnl0aGluZyB0b3dhcmQgYSBmaXggb24gdGhpcz8gIEkgc3BlbnQgdG9kYXkg dGFraW5nCmFub3RoZXIgbG9vayBhdCBpdC4uLi4KClRoZSBvYmplY3Qgc3RydWN0dXJlIGlzIHNl bGYtcmVmZXJlbnRpYWwgKHRoZSBQVklPIGNvbnRhaW5zIGEKcmVmZXJlbmNlIGJhY2sgdG8gdGhl IFBWR1YpOgoKU1YgPSBSVigweDg0MmZiMmMpIGF0IDB4ODVmNzYxOAogIFJFRkNOVCA9IDEKICBG TEFHUyA9IChQQURCVVNZLFBBRE1ZLFJPSykKICBSViA9IDB4ODY4MWE2MAogIFNWID0gUFZHVigw eDg2MWM4ZjApIGF0IDB4ODY4MWE2MAogICAgUkVGQ05UID0gMgogICAgRkxBR1MgPSAoT0JKRUNU LEdNRyxTTUcsTVVMVEkpCiAgICBJViA9IDE0MDYyNzE0NAogICAgTlYgPSAwCiAgICBNQUdJQyA9 IDB4ODYxYzcyOAogICAgICBNR19WSVJUVUFMID0gJlBMX3Z0YmxfYmFja3JlZgogICAgICBNR19U WVBFID0gUEVSTF9NQUdJQ19iYWNrcmVmKDwpCiAgICAgIE1HX0ZMQUdTID0gMHgwMgogICAgICAg IFJFRkNPVU5URUQKICAgICAgTUdfT0JKID0gMHg4NjgxOWU4CiAgICAgIFNWID0gUFZBVigweDg2 N2QyZTgpIGF0IDB4ODY4MTllOAogICAgICAgIFJFRkNOVCA9IDIKICAgICAgICBGTEFHUyA9ICgp CiAgICAgICAgSVYgPSAwCiAgICAgICAgTlYgPSAwCiAgICAgICAgQVJSQVkgPSAweDg2MWM4YTAK ICAgICAgICBGSUxMID0gMAogICAgICAgIE1BWCA9IDMKICAgICAgICBBUllMRU4gPSAweDAKICAg ICAgICBGTEFHUyA9IChSRUFMKQogICAgICAgIEVsdCBOby4gMAogICAgICAgIFNWID0gUlYoMHg4 NDJmYjI4KSBhdCAweDg2ODFhNTQKICAgICAgICAgIFJFRkNOVCA9IDEKICAgICAgICAgIEZMQUdT ID0gKFJPSyxXRUFLUkVGKQogICAgICAgICAgUlYgPSAweDg2ODFhNjAKICAgICAgICAgIFNWID0g UFZHVigweDg2MWM4ZjApIGF0IDB4ODY4MWE2MAogICAgICAgICAgICBSRUZDTlQgPSAyCiAgICAg ICAgICAgIEZMQUdTID0gKE9CSkVDVCxHTUcsU01HLE1VTFRJKQogICAgICAgICAgICBJViA9IDE0 MDYyNzE0NAogICAgICAgICAgICBOViA9IDAKICAgICAgICAgICAgTUFHSUMgPSAweDg2MWM3MjgK ICAgICAgICAgICAgICBNR19WSVJUVUFMID0gJlBMX3Z0YmxfYmFja3JlZgogICAgICAgICAgICAg IE1HX1RZUEUgPSBQRVJMX01BR0lDX2JhY2tyZWYoPCkKICAgICAgICAgICAgICBNR19GTEFHUyA9 IDB4MDIKICAgICAgICAgICAgICAgIFJFRkNPVU5URUQKICAgICAgICAgICAgICBNR19PQkogPSAw eDg2ODE5ZTgKICAgICAgICAgICAgICBTViA9IFBWQVYoMHg4NjdkMmU4KSBhdCAweDg2ODE5ZTgK ICAgICAgICAgICAgICAgIFJFRkNOVCA9IDIKICAgICAgICAgICAgICAgIEZMQUdTID0gKCkKICAg ICAgICAgICAgICAgIElWID0gMAogICAgICAgICAgICAgICAgTlYgPSAwCiAgICAgICAgICAgICAg ICBBUlJBWSA9IDB4ODYxYzhhMAogICAgICAgICAgICAgICAgRklMTCA9IDAKICAgICAgICAgICAg ICAgIE1BWCA9IDMKICAgICAgICAgICAgICAgIEFSWUxFTiA9IDB4MAogICAgICAgICAgICAgICAg RkxBR1MgPSAoUkVBTCkKICAgICAgICAgICAgTUFHSUMgPSAweDg2MWM3ZDAKICAgICAgICAgICAg ICBNR19WSVJUVUFMID0gJlBMX3Z0YmxfZ2xvYgogICAgICAgICAgICAgIE1HX1RZUEUgPSBQRVJM X01BR0lDX2dsb2IoKikKICAgICAgICAgICAgICBNR19PQkogPSAweDg2ODFhNjAKICAgICAgICAg ICAgU1RBU0ggPSAweDg1YjllZDQgICAiTmV0OjpTU0gyOjpDaGFubmVsIgogICAgICAgICAgICBO QU1FID0gIl9HRU5fMCIKICAgICAgICAgICAgTkFNRUxFTiA9IDYKICAgICAgICAgICAgR3ZTVEFT SCA9IDB4ODViOWVkNCAiTmV0OjpTU0gyOjpDaGFubmVsIgogICAgICAgICAgICBHUCA9IDB4ODYx ZDQyMAogICAgICAgICAgICAgIFNWID0gMHg4NjgxOWRjCiAgICAgICAgICAgICAgUkVGQ05UID0g MQogICAgICAgICAgICAgIElPID0gMHg4NjgxOWQwCiAgICAgICAgICAgICAgRk9STSA9IDB4MAog ICAgICAgICAgICAgIEFWID0gMHgwCiAgICAgICAgICAgICAgSFYgPSAweDAKICAgICAgICAgICAg ICBDViA9IDB4ODY4MTlmNAogICAgICAgICAgICAgIENWR0VOID0gMHgwCiAgICAgICAgICAgICAg R1BGTEFHUyA9IDB4MAogICAgICAgICAgICAgIExJTkUgPSA5MwogICAgICAgICAgICAgIEZJTEUg PSAidC9OZXQtU1NIMi50IgogICAgICAgICAgICAgIEZMQUdTID0gMHgyCiAgICAgICAgICAgICAg RUdWID0gMHg4NjgxYTYwICAgIl9HRU5fMCIKICAgIE1BR0lDID0gMHg4NjFjN2QwCiAgICAgIE1H X1ZJUlRVQUwgPSAmUExfdnRibF9nbG9iCiAgICAgIE1HX1RZUEUg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SBhdCAweDg2ODFhNTQKICAgICAgICBSRUZDTlQgPSAxCiAgICAgICAgRkxBR1MgPSAo Uk9LLFdFQUtSRUYpCiAgICAgICAgUlYgPSAweDg2ODFhNjAKICAgICAgICBTViA9IFBWR1YoMHg4 NjFjOGYwKSBhdCAweDg2ODFhNjAKICAgICAgICAgIFJFRkNOVCA9IDIKICAgICAgICAgIEZMQUdT ID0gKE9CSkVDVCxHTUcsU01HLE1VTFRJKQogICAgICAgICAgSVYgPSAxNDA2MjcxNDQKICAgICAg ICAgIE5WID0gMAogICAgICAgICAgTUFHSUMgPSAweDg2MWM3MjgKICAgICAgICAgICAgTUdfVklS VFVBTCA9ICZQTF92dGJsX2JhY2tyZWYKICAgICAgICAgICAgTUdfVFlQRSA9IFBFUkxfTUFHSUNf YmFja3JlZig8KQogICAgICAgICAgICBNR19GTEFHUyA9IDB4MDIKICAgICAgICAgICAgICBSRUZD T1VOVEVECiAgICAgICAgICAgIE1HX09CSiA9IDB4ODY4MTllOAogICAgICAgICAgICBTViA9IFBW QVYoMHg4NjdkMmU4KSBhdCAweDg2ODE5ZTgKICAgICAgICAgICAgICBSRUZDTlQgPSAyCiAgICAg ICAgICAgICAgRkxBR1MgPSAoKQogICAgICAgICAgICAgIElWID0gMAogICAgICAgICAgICAgIE5W ID0gMAogICAgICAgICAgICAgIEFSUkFZID0gMHg4NjFjOGEwCiAgICAgICAgICAgICAgRklMTCA9 IDAKICAgICAgICAgICAgICBNQVggPSAzCiAgICAgICAgICAgICAgQVJZTEVOID0gMHgwCiAgICAg ICAgICAgICAgRkxBR1MgPSAoUkVBTCkKICAgICAgICAgIE1BR0lDID0gMHg4NjFjN2QwCiAgICAg ICAgICAgIE1HX1ZJUlRVQUwgPSAmUExfdnRibF9nbG9iCiAgICAgICAgICAgIE1HX1RZUEUgPSBQ RVJMX01BR0lDX2dsb2IoKikKICAgICAgICAgICAgTUdfT0JKID0gMHg4NjgxYTYwCiAgICAgICAg ICBTVEFTSCA9IDB4ODViOWVkNCAgICAgIk5ldDo6U1NIMjo6Q2hhbm5lbCIKICAgICAgICAgIE5B TUUgPSAiX0dFTl8wIgogICAgICAgICAgTkFNRUxFTiA9IDYKICAgICAgICAgIEd2U1RBU0ggPSAw eDg1YjllZDQgICAiTmV0OjpTU0gyOjpDaGFubmVsIgogICAgICAgICAgR1AgPSAweDg2MWQ0MjAK ICAgICAgICAgICAgU1YgPSAweDg2ODE5ZGMKICAgICAgICAgICAgUkVGQ05UID0gMQogICAgICAg ICAgICBJTyA9IDB4ODY4MTlkMAogICAgICAgICAgICBGT1JNID0gMHgwCiAgICAgICAgICAgIEFW ID0gMHgwCiAgICAgICAgICAgIEhWID0gMHgwCiAgICAgICAgICAgIENWID0gMHg4NjgxOWY0CiAg ICAgICAgICAgIENWR0VOID0gMHgwCiAgICAgICAgICAgIEdQRkxBR1MgPSAweDAKICAgICAgICAg ICAgTElORSA9IDkzCiAgICAgICAgICAgIEZJTEUgPSAidC9OZXQtU1NIMi50IgogICAgICAgICAg ICBGTEFHUyA9IDB4MgogICAgICAgICAgICBFR1YgPSAweDg2ODFhNjAgICAgICJfR0VOXzAiCiAg ICBJRlAgPSAweDAKICAgIE9GUCA9IDB4MAogICAgRElSUCA9IDB4MAogICAgTElORVMgPSAwCiAg ICBQQUdFID0gMAogICAgUEFHRV9MRU4gPSA2MAogICAgTElORVNfTEVGVCA9IDAKICAgIFRPUF9H ViA9IDB4MAogICAgRk1UX0dWID0gMHgwCiAgICBCT1RUT01fR1YgPSAweDAKICAgIFNVQlBST0NF U1MgPSAwCiAgICBUWVBFID0gJ1wwJwogICAgRkxBR1MgPSAweDAKCklzIHRoaXMgYSBzZWxmLXRp ZWQgZmlsZWhhbmRsZT8gIEFyZW4ndCB0aG9zZSBicm9rZW4gaW4gNS44Lng/ICBNYXliZQp0aGlz IGp1c3QgbmVlZHMgdG8gYmUgcmVpbXBsZW1lbnRlZC4KCk9uIDQvNy8wNiwgU3RlcGhlbiBDbG91 c2UgPHN0ZXBoZW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WUgcHJvYmxlbS4gIEV2ZW4gd2hlbiB0aGUgY2hh bm5lbAo+IG9iamVjdCBnb2VzIG91dCBvZiBzY29wZSBpbiBvdXIgcHJvZ3JhbSwgaXRzIGRlc3Ry dWN0b3IgaXMgbm90IGNhbGxlZCwKPiBhbmQgc28gdGhlIE5ldDo6U1NIMiBvYmplY3QgaXMgbm90 IGRlc3Ryb3llZCBlaXRoZXIuCj4KPiBBbnkgaGVscCBpcyBhcHByZWNpYXRlZC4KPgo+IC0tCj4g U3RlcGhlbiBDbG91c2UgPHN0ZXBoZW5jbG91c2VAZ21haWwuY29tPgo+CgotLQpTdGVwaGVuIENs b3VzZSA8c3RlcGhlbmNsb3VzZUBnbWFpbC5jb20+Cg== |
From: Matthew J. S. <vag...@ya...> - 2006-05-02 19:21:43
|
--- CNewtonne <cne...@ya...> wrote: > <!-- DIV {margin:0px} -->RMAN or recovery manager is > a server tool Oracle uses to managed backup and > recovery. Using an ssh connection, I've successfully > automated the process of runing RMAN cmds remotely. > It basically reads a local file where the perl code > is running, dumps it into a scaler variable which is > eventually echoed to a file on the remote server. > RMAN gets invoked to execute this file. This code > was tested and worked on 50 nodes without a glitch. > However, it is failing on this node as seen below. > For the life of me, I can not explain this behavior. > It is either I'm misreading the issue or there is > something about ssh that I do not know yet. > > These are the facts... > 1) RMAN code (test.rmn): > connect target '; > exit > 2) when logged in interactively vis an ssh > connection ,this command works just fine > rmn cmdfile=test.rmn > > 3) However, this command errors out (same error > using this module) > ssh 10.10.10.10 "export ORACLE_SID=prod2;. > /home/oracle/.profile;\ $ORACLE_HOME/bin/rman > cmdfile=test.rmn" > > RMAN> connect target /; > 2> > 3> allocate channel for maintenance type disk ; > 4> > RMAN-00571: > =========================================================== > > RMAN-00569: =============== ERROR MESSAGE STACK > FOLLOWS =============== > RMAN-00571: > =========================================================== > > ORA-00210: cannot open the specified controlfile > ORA-00202: controlfile: '/dev/rprod1_0128_003' > ORA-27041: unable to open file > Additional information: 7 > > The DB is up and running, all control files are > accessible (physically exist and permissions are > good), no msgs in alert or trace files to support a > CF access issue. The above command works fine if ran > against a non-rac DB on same host. The DB causing > the issue is rac on HACMP. > I have confirmed the same issue occurs running > SQLPLUS as well. For some reason, invoking these > utils remotly causes them to fail to read from the > DB files. > > I will pay a milltion dollar for anyone who > provides a significant lead (kidding) > > When I see a problem like this, I immediately say that it's the environment. Log in interactivly and check the output of env against what the following returns when you insert it into your code. "export ORACLE_SID=prod2;. /home/oracle/.profile;\ env" The other option is to use a shell style interface. I posted an example on the list. Since it's only few commands you are executing, it should be pretty simple to setup. http://sourceforge.net/mailarchive/forum.php?thread_id=10084037&forum_id=36514 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: CNewtonne <cne...@ya...> - 2006-05-02 18:42:07
|
<!-- DIV {margin:0px} -->RMAN or recovery manager is a server tool Oracle uses to managed backup and recovery. Using an ssh connection, I've successfully automated the process of runing RMAN cmds remotely. It basically reads a local file where the perl code is running, dumps it into a scaler variable which is eventually echoed to a file on the remote server. RMAN gets invoked to execute this file. This code was tested and worked on 50 nodes without a glitch. However, it is failing on this node as seen below. For the life of me, I can not explain this behavior. It is either I'm misreading the issue or there is something about ssh that I do not know yet. These are the facts... 1) RMAN code (test.rmn): connect target '; exit 2) when logged in interactively vis an ssh connection ,this command works just fine rmn cmdfile=test.rmn 3) However, this command errors out (same error using this module) ssh 10.10.10.10 "export ORACLE_SID=prod2;. /home/oracle/.profile;\ $ORACLE_HOME/bin/rman cmdfile=test.rmn" RMAN> connect target /; 2> 3> allocate channel for maintenance type disk ; 4> RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== ORA-00210: cannot open the specified controlfile ORA-00202: controlfile: '/dev/rprod1_0128_003' ORA-27041: unable to open file Additional information: 7 The DB is up and running, all control files are accessible (physically exist and permissions are good), no msgs in alert or trace files to support a CF access issue. The above command works fine if ran against a non-rac DB on same host. The DB causing the issue is rac on HACMP. I have confirmed the same issue occurs running SQLPLUS as well. For some reason, invoking these utils remotly causes them to fail to read from the DB files. I will pay a milltion dollar for anyone who provides a significant lead (kidding) |
From: Matthew J. S. <vag...@ya...> - 2006-04-21 13:13:24
|
--- Joel Lansden <Jo...@di...> wrote: > Greetings all, > > I am trying to use Net::SSH::Perl to execute remote > commands on a server > via SSH. Unfortunately, it appears that any > commands that require > arguments will crash the module. > For example, if I do "ls" it works fine.. But if I > send "ls -l" it will > give me this: > > -------------------------------------------------------- > input must be 8 bytes long at > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm > line > 57. > -------------------------------------------------------- > > Does anyone have a fix for this? > > Thanks!!! > ~Joel There are 2 things that I would recomend trying. One of the solutions will solve your problem (99% sure). 1. my($out, $err, $exit) = $ssh->cmd($cmd, [ $stdin ]) ex. my($out, $err, $exit) = $ssh->cmd("ls", "-l") 2. use Encode; use Encode; ... Encode::from_to($cmd,'utf8','iso-8859-1'); my($out, $err, $exit) = $ssh->cmd("ls", "-l") ... Good luck __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Joel L. <Jo...@di...> - 2006-04-21 12:44:56
|
Greetings all, =20 I am trying to use Net::SSH::Perl to execute remote commands on a server via SSH. Unfortunately, it appears that any commands that require arguments will crash the module. For example, if I do "ls" it works fine.. But if I send "ls -l" it will give me this: -------------------------------------------------------- input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm line 57. -------------------------------------------------------- Does anyone have a fix for this? Thanks!!! ~Joel |
From: Matthew J. S. <vag...@ya...> - 2006-04-20 14:59:07
|
--- Ajit <aji...@re...> wrote: > Hi Matthew, > I made changes suggested by you , > but it is still giving me these unwanted messages. > > I tryed following things , > > my($stdout, $stderr, $exit) = $ssh->cmd($cmd); > print $stdout; > > As well as ( just to try ) > > my(@stdout, @stderr, $exit) = $ssh->cmd($cmd); > print @stdout; > > Thanks > ~ajit > > Yeah, the changes I sent you won't get rid of the IO::Socket and IO::String warnings. It will just get rid of the "0" at the end of the output. I only gave you the solution to 1 of your questions. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Ajit <aji...@re...> - 2006-04-20 13:44:56
|
Hi Matthew,=0AI made changes suggested by you ,=0Abut it is still giving me= these unwanted messages.=0A=0AI tryed following things ,=0A=0Amy($stdout, = $stderr, $exit) =3D $ssh->cmd($cmd);=0Aprint $stdout;=0A=0AAs well as ( jus= t to try )=0A =0Amy(@stdout, @stderr, $exit) =3D $ssh->cmd($cmd);=0Aprint @= stdout; =0A=0AThanks=0A~ajit=0A=0A=0AOn Thu, 20 Apr 2006 Matthew J.Salerno = wrote :=0A>--- Ajit <aji...@re...> wrote:=0A>=0A> > Hi Guys,=0A= > > I have written a small perl script=0A> >=0A> > #!/usr/bin/perl=0A> > us= e strict;=0A> > use Net::SSH::w32Perl;=0A> > use Net::SSH::Perl;=0A> >=0A> = > my $user =3D "root";=0A> > my $pass =3D "password";=0A> > my $host =3D "1= 92.168.0.123";=0A> > my $cmd =3D "ls -lt";=0A> > my $ssh =3D Net::SSH::W32P= erl->new($host);=0A> >=0A> > $ssh->login($user, $pass);=0A> > my @test =3D = $ssh->cmd($cmd);=0A> > print @test;=0A> >=0A> >=0A> > The script when execu= ted gives desired output ,=0A> > but it gives some additional messages befo= re giving=0A> > proper output=0A> > these messages are as follows ,=0A> >= =0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line= 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm = line 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2= .pm line 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/= SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/SSH/Perl/Ch= annel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/= Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/SSH/Pe= rl/Channel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net= /SSH/Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/S= SH/Perl/Channel.pm line 110=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/= SSH/Perl/Channel.pm line 118=0A> > IO::Socket::INET at=0A> > C:/Perl/site/l= ib/Net/SSH/Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib= /Net/SSH/Perl/Channel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/s= ite/lib/Net/SSH/Perl/SSH2.pm line 295=0A> > total 9250=0A> > dr-xr-xr-x 52= root root 63168 Apr 20=0A> > 15:56 proc=0A> > drwxrwxrwt 4 roo= t sys 249 Apr 20=0A> > 15:55 tmp=0A> > drwxr-xr-x 17 root = sys 4096 Apr 20=0A> > 11:00 dev=0A> > -rw-r--r-- 1 root root= 13770 Apr 20=0A> > 11:00 buildsanity=0A> > dr-xr-xr-x 6 root r= oot 512 Apr 13=0A> > 14:05 vol=0A> > drwxr-xr-x 75 root sys = 4096 Apr 13=0A> > 14:05 etc=0A> > dr-xr-xr-x 1 root root = 1 Apr 13=0A> > 14:05 home=0A> > dr-xr-xr-x 1 root root = 1 Apr 13=0A> > 14:05 net=0A> > drwxr-xr-x 2 root sys 512 Apr= 13=0A> > 14:03 devices=0A> > drwxr-xr-x 2 root root 512 Apr = 5=0A> > 15:43 Documents=0A> > drwxr-xr-x 40 root sys 1024 Mar= 30=0A> > 11:24 usr=0A> > drwxr-xr-x 8 14478 staff 512 Mar 23= =0A> > 16:20 opt=0A> > drwxr-xr-x 6 root root 512 Mar 21=0A> = > 16:55 cdrom=0A> > -rw-r--r-- 1 root root 26 Mar 20=0A> > 1= 4:52 sdm=0A> > drwxr-xr-x 2 root root 512 Mar 20=0A> > 14:11 = Desktop=0A> > -rw-rw-r-- 1 root gsm 68624 Mar 3=0A> > 19:44 M= essage.log=0A> > drwxr-xr-x 11 root sys 512 Mar 2=0A> > 15:2= 7 mnt=0A> > -rwxr-xr-x 1 root root 607744 Feb 23=0A> > 13:27 ssh= .tar=0A> > -rwxr-xr-x 1 root root 93184 Feb 23=0A> > 12:45 tar.= sh=0A> > drwxr-xr-x 2 root root 512 Feb 23=0A> > 11:16 TT_DB= =0A> > drwxr-xr-x 41 root sys 1024 Feb 23=0A> > 11:12 var=0A> = > drwxr-xr-x 7 root bin 5120 Feb 23=0A> > 10:53 lib=0A> > drw= xr-xr-x 14 root sys 512 Feb 22=0A> > 19:12 kernel=0A> > drwxr= -xr-x 2 root sys 1024 Feb 22=0A> > 19:06 sbin=0A> > drwxr-xr-= x 33 root sys 1024 Feb 22=0A> > 18:38 platform=0A> > drwxr-xr-= x 4 root root 512 Feb 22=0A> > 18:38 system=0A> > lrwxrwxrwx = 1 root root 9 Feb 22=0A> > 18:38 bin -> ./usr/bin=0A> > drw= xr-xr-x 3 root sys 512 Feb 22=0A> > 18:37 export=0A> > drwx-= -x--x 2 root root 8192 Feb 22=0A> > 18:37 lost+found=0A> > 0= =0A> >=0A> > How can i overcome these additional messages and=0A> > "0" af= ter my desired output.=0A> >=0A> > Thanks=0A> > ~ajit=0A> >=0A>=0A>=0A>The = 0 that gets printed at the end is the exit code of=0A>the command you are e= xecuting.=0A>=0A>Change:=0A>my @test =3D $ssh->cmd($cmd);=0A>print @test;= =0A>=0A>To:=0A>my($stdout, $stderr, $exit) =3D $ssh->cmd($cmd);=0A>print $s= tdout;=0A>=0A>What version of Net::SSH::Perl are you using?=0A>=0A>=0A>=0A>= __________________________________________________=0A>Do You Yahoo!?=0A>Tir= ed of spam? Yahoo! Mail has the best spam protection around=0A>http://mail= .yahoo.com=0A=0A=0AMobile :- 9890671707=0D=0A=0D=0A"Success is not the resu= lt of spontaneous combustion. You must set yourself on fire." =0D=0A=0D=0A |
From: Matthew J. S. <vag...@ya...> - 2006-04-20 13:24:20
|
--- Ajit <aji...@re...> wrote: > Hi Guys, > I have written a small perl script > > #!/usr/bin/perl > use strict; > use Net::SSH::w32Perl; > use Net::SSH::Perl; > > my $user = "root"; > my $pass = "password"; > my $host = "192.168.0.123"; > my $cmd = "ls -lt"; > my $ssh = Net::SSH::W32Perl->new($host); > > $ssh->login($user, $pass); > my @test = $ssh->cmd($cmd); > print @test; > > > The script when executed gives desired output , > but it gives some additional messages before giving > proper output > these messages are as follows , > > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > total 9250 > dr-xr-xr-x 52 root root 63168 Apr 20 > 15:56 proc > drwxrwxrwt 4 root sys 249 Apr 20 > 15:55 tmp > drwxr-xr-x 17 root sys 4096 Apr 20 > 11:00 dev > -rw-r--r-- 1 root root 13770 Apr 20 > 11:00 buildsanity > dr-xr-xr-x 6 root root 512 Apr 13 > 14:05 vol > drwxr-xr-x 75 root sys 4096 Apr 13 > 14:05 etc > dr-xr-xr-x 1 root root 1 Apr 13 > 14:05 home > dr-xr-xr-x 1 root root 1 Apr 13 > 14:05 net > drwxr-xr-x 2 root sys 512 Apr 13 > 14:03 devices > drwxr-xr-x 2 root root 512 Apr 5 > 15:43 Documents > drwxr-xr-x 40 root sys 1024 Mar 30 > 11:24 usr > drwxr-xr-x 8 14478 staff 512 Mar 23 > 16:20 opt > drwxr-xr-x 6 root root 512 Mar 21 > 16:55 cdrom > -rw-r--r-- 1 root root 26 Mar 20 > 14:52 sdm > drwxr-xr-x 2 root root 512 Mar 20 > 14:11 Desktop > -rw-rw-r-- 1 root gsm 68624 Mar 3 > 19:44 Message.log > drwxr-xr-x 11 root sys 512 Mar 2 > 15:27 mnt > -rwxr-xr-x 1 root root 607744 Feb 23 > 13:27 ssh.tar > -rwxr-xr-x 1 root root 93184 Feb 23 > 12:45 tar.sh > drwxr-xr-x 2 root root 512 Feb 23 > 11:16 TT_DB > drwxr-xr-x 41 root sys 1024 Feb 23 > 11:12 var > drwxr-xr-x 7 root bin 5120 Feb 23 > 10:53 lib > drwxr-xr-x 14 root sys 512 Feb 22 > 19:12 kernel > drwxr-xr-x 2 root sys 1024 Feb 22 > 19:06 sbin > drwxr-xr-x 33 root sys 1024 Feb 22 > 18:38 platform > drwxr-xr-x 4 root root 512 Feb 22 > 18:38 system > lrwxrwxrwx 1 root root 9 Feb 22 > 18:38 bin -> ./usr/bin > drwxr-xr-x 3 root sys 512 Feb 22 > 18:37 export > drwx--x--x 2 root root 8192 Feb 22 > 18:37 lost+found > 0 > > How can i overcome these additional messages and > "0" after my desired output. > > Thanks > ~ajit > The 0 that gets printed at the end is the exit code of the command you are executing. Change: my @test = $ssh->cmd($cmd); print @test; To: my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout; What version of Net::SSH::Perl are you using? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |