I've also used dsh[1] to accomplish the same thing. Never tried to use username and password for this though so that actually may be more of a pain with dsh. Also tailing multiple files on the same host is pretty cool.
I have no problem with people writing cool little tools like this in whatever language, but there seems to be a chronic lack of understanding of what existing tools can do.
multitail() {
com="tail -f "
for arg; do
IFS=':' read -a array <<< "$arg"
host="${array[0]}"
file="${array[1]}"
com="$com <(ssh -t $host 'tail -f $file')"
done
eval ${com}
}
This will take the host:file syntax of remtail and turn it into Plugawy's example. I haven't tested it, but if you echo "$com" it'll spit out Plugawy's code.
In my company, we have hundred machines and tailing done with ansible. If we want customize the log view, we can simply edit the playbook. I think it is very handy compared to we need additional npm package (and not to mention additional effort for customization).
19 comments
[ 2.9 ms ] story [ 47.7 ms ] thread[1] - http://www.tecmint.com/using-dsh-distributed-shell-to-run-li...
mssh or cluster ssh is also effective in this manner, with the added flexibility of ssh terminals.
Serious question - I actually would like to see how you'd do it.
http://www.gnu.org/software/inetutils/manual/html_node/The-_...
[1]: http://linux.die.net/man/1/pssh
You'll want -i to avoid the buffered output that would make the log output hard to read.
And if your command doesn't contain anything that you need to escape from the shell, you don't need to quote the command.
And finally, since it implements BSD-style short flags correctly, so you can do "-Pi" instead of "-P -i".
Handy with a pre-defined list of hosts, too:
or a specific set of hosts:http://dougmart.in/projects/pagepipe