dnsserver / parallel-ssh

Automatically exported from code.google.com/p/parallel-ssh
Other
0 stars 0 forks source link

Outfile Problem with same host and different ports #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I reported this bug to the Debian Project :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549107

I'm using a patched version of pssh to solve the bug (see debian bug report).

Thanks in advance,
Marc

Original issue reported on code.google.com by dooblem...@positon.org on 21 Dec 2009 at 1:15

GoogleCodeExporter commented 8 years ago
Hmm.  It looks like you're using a pre-2.0 version of pssh.  In pssh 2.0, if a 
host is 
specified more than once, it will create multiple files: first "hostname", then 
"hostname.1", "hostname.2", etc.  This works even if the host is specified 
twice with 
the same port.  Does this address your problem, or is there a use case where 
the port 
really needs to be included in the filename?  Thanks.

Original comment by amcna...@gmail.com on 16 Feb 2010 at 7:47

GoogleCodeExporter commented 8 years ago
In fact it's not very convenient to have the output files named .1 .2 .3

After I launched my pssh command, I look in the output folder, and it's very
difficult to retrieve the host from the .X file. (you have to look for the Xth
position in your host file).

It is far better to have the exact host name in the output file.

What do you think ?

Original comment by dooblem...@positon.org on 18 Feb 2010 at 4:52

GoogleCodeExporter commented 8 years ago
Thanks for your opinions.  Let me give you a little more justification for the 
way things are being 
done right now, and then ask you a few questions to help find a way to make 
things better.

I think .1 .2 .3 will always be necessary because sometimes you connect to the 
exact same host multiple 
times.  Suppose I run `pssh -h hosts_file -h hosts_file -h hosts_file -o output 
some_command`.  Then 
there need to be separate output files, but there is no way to distinguish the 
different connections to 
the same hosts.

It sounds like your need is to be able to distinguish between connections by 
the port as well as the 
host.  What would you think of making the filename be of the form 
"username@hostname:port.number", 
where the username and port are only added if non-default?  A few examples:

- If I connect to athena three times, the files' names are "athena", 
"athena.1", and "athena.2".
- If I connect to athena twice with port 50, the filenames are "athena:50" and 
"athena:50.1".
- If I connect to athena once with username jdoe and once with port 50, the 
filenames are "jdoe@athena" 
and "athena:50".

I would love to hear your thoughts on this proposal, as well as any alternate 
proposals you have in 
mind.  Thanks for your help with pssh.

Original comment by amcna...@gmail.com on 18 Feb 2010 at 6:31

GoogleCodeExporter commented 8 years ago

Original comment by amcna...@gmail.com on 18 Feb 2010 at 6:31

GoogleCodeExporter commented 8 years ago
I totaly agree with your idea.

To my mind the output file name should be the closest of the line format in the
hosts_file. But of course it's not possible because the username is separated 
with a
space (new idea: change the hosts_file format.).

Thanks!

Original comment by dooblem...@positon.org on 19 Feb 2010 at 2:37

GoogleCodeExporter commented 8 years ago
Okay.  I just made a commit that should implement the behavior described in 
comment 
#3.  Would you please test this and see if it works for you?

You have a good point about the format of the hosts file (where 
"user@host:port" would 
probably make more sense than "host:port user").  However, this is really a 
separate 
issue; would you please open a new issue for this?  Thanks for your help.

Original comment by amcna...@gmail.com on 19 Feb 2010 at 6:06

GoogleCodeExporter commented 8 years ago
Hello,

I cloned the git repo.
I get the following error :

pssh/bin$ ./pssh -v -h /tmp/hosts -o /tmp/output/ -e /tmp/error/ ls
Traceback (most recent call last):
  File "./pssh", line 115, in <module>
    if opts.host_entries:
AttributeError: Values instance has no attribute 'host_entries'

Am I calling pssh properly ?

Thanks in advance
Marc

Original comment by dooblem...@positon.org on 22 Feb 2010 at 10:30

GoogleCodeExporter commented 8 years ago
I tried reproducing the error you just posted, but I wasn't able to get this 
exception.  I think the problem is that there is an older version of psshlib 
somewhere 
on your Python path.  I've now pushed a change that I think will address your 
problem.  
Would you mind doing a "git pull" and trying again?  Thanks for your help.

Original comment by amcna...@gmail.com on 22 Feb 2010 at 5:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks. It works perfectly :

pssh/bin$ cat hosts 
SERVER
SERVER
SERVER:222
SERVER:222
pssh/bin$ ./pssh -h hosts -o output/ -e error/ ls
[1] 08:58:31 [SUCCESS] SERVER:222
[2] 08:58:31 [SUCCESS] SERVER
[3] 08:58:31 [SUCCESS] SERVER
[4] 08:58:31 [SUCCESS] SERVER:222
pssh/bin$ ls -l output/*
-rw-r--r-- 1 mamau mamau 37 24 févr. 08:58 output/SERVER
-rw-r--r-- 1 mamau mamau 37 24 févr. 08:58 output/SERVER.1
-rw-r--r-- 1 mamau mamau 12 24 févr. 08:58 output/SERVER:222
-rw-r--r-- 1 mamau mamau 12 24 févr. 08:58 output/SERVER:222.1

Original comment by dooblem...@positon.org on 24 Feb 2010 at 8:13

GoogleCodeExporter commented 8 years ago
Great.  Thanks for reporting the problem and testing the changes.

Original comment by amcna...@gmail.com on 24 Feb 2010 at 4:08