[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG

2021-12-30 Thread Marco Möller

On 30.12.21 17:38, Nicholas Geovanis wrote:

Aside from shell loops, I've also in the past used dsh which is
still packaged in Debian:

http://www.netfort.gr.jp/~dancer/software/dsh.html



Other similar options are pdksh, public domain Korn shell. Which is 
available in Debian repositories for some releases. And the dsh command 
on IBM's aix unix-ish OS :-) So with NIM support :-) looking like rsh.


…but these days I also switched to using Ansible ad hoc commands and
playbooks for anything I do repeatedly. Well worth looking into.


The same can be said of the salt utility. Supported at cost by Saltstack 
if necessary. But IMO not the same use-case that the OP intended. One 
salt contributor some time ago was managing more than 10K servers with 
it, I only had a few hundred.


I'll keep these tools in mind for some possible future usage. Right now 
they seem to not exactly be what I was searching for, but obviously my 
initial question was lacking a proper description of my aspired usage 
scenario, especially the wish to keep sessions running interactively 
while also sending ad hoc commands simultanously to all these sessions.

Your answer is much appreciated, thanks a lot for it, and best wishes!
Marco



[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG

2021-12-30 Thread Marco Möller

On 30.12.21 15:06, Charles Curley wrote:

On Thu, 30 Dec 2021 14:54:40 +0100
Marco Möller  wrote:


Do you know about such feature to be implemented in some Linux tool?


Take a look at mssh.



I will test it, although I spontaneously from reading do not expect it 
to be as comfortable as tmux with its synchronize panes functionality or 
clusterssh. However, a real test and figuring out how to properly make 
use this tool might surprise me!

Thanks a lot, and best wishes,
Marco



[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG

2021-12-30 Thread Marco Möller



On 30.12.21 15:13, Celejar wrote:

On Thu, 30 Dec 2021 14:54:40 +0100
Marco Möller  wrote:



In search for a software recommendation:
The remote session management app "mRemoteNG" for MS Windows comes with
a functionality by which a command can be entered to its "Multi SSH"
input field, and this command is then sent to all SSH connected remote
systems at once as if the command would have been typed in at each
single of the SSH connected remote systems CLI individually.
Do you know about such feature to be implemented in some Linux tool?
Maybe it even exists as a plugin for tmux?


I'm not sure about tools that send commands to multiple hosts already
connected over SSH, but there are some that are designed to execute the
same command on multiple hosts by initiating SSH connections to them,
such as pssh and clusterssh:

https://code.google.com/archive/p/parallel-ssh/
https://linux.die.net/man/1/pssh

https://github.com/duncs/clusterssh

https://unix.stackexchange.com/questions/505159/how-to-run-the-same-command-on-multiple-servers
https://www.tecmint.com/run-commands-on-multiple-linux-servers/
https://unix.stackexchange.com/questions/19008/automatically-run-commands-over-ssh-on-many-servers

Celejar



Many great suggestions! It took me some time to follow all suggested 
links. Spontaneously it appears to me that clusterssh would best fit my 
special needs, and this tool would compete with the tmux functionality 
to synchronize panes when needed, as mentioned in one of the linked 
threads and then also suggested by Andy. I will test both options.

Thanks a lot for your great help, and best wishes,
Marco



[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG

2021-12-30 Thread Marco Möller

On 30.12.21 18:04, Andy Smith wrote:

Hi Marco,

On Thu, Dec 30, 2021 at 05:49:38PM +0100, Marco Möller wrote:

As my aim is to interactively run the same commands on several machines, in
order to observe if they everywhere behave the same or what different
results they would produce, does each SSH session report back to Ansible the
console output of the command, or allow interactivity with the session like
answering questions at the console if the command would produce a question,
as tmux allows such interactivity? Or is Ansible thought to send
non-interactive commands which are supposed to not write output back to a
visible console?


While dsh or Ansible ad-hoc commands would report back the output,
Ansible won't work for / isn't designed for interactive use and it
would be quite awkward in dsh too. Wouldn't work for full terminal
applications and the like. So config management, ssh multilaunchers
and shell loops aren't the right topol for this.

If all you want to do is launch the same command everywhere, it's
pretty simple in tmux. Get all your logins in different panels and
then synchronize them so the same command is launched in all. Then
unsync to go through and interact individually again.

 
https://stackoverflow.com/questions/16325449/how-to-send-a-command-to-all-panes-in-tmux

Basically you are wanting a scriptable full terminal, so tmux fits
the bill I think. You can remote control it from outside in many
ways to get it to do what you want.

Cheers,
Andy



I have had a first look to the suggested thread at stackoverflow and 
will try it out. It sounds very good, very promising, targeting my needs 
and I assume it to work well!


Thanks a lot, and best wishes!
Marco