Re:Show HN: Tail out log files from multiple remote hosts wi...
by voltagex_ on Sunday February 22, 2015 @04:28PM
(#9091193)
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.
Re:Show HN: Tail out log files from multiple remote hosts wi...
by vlad003 on Sunday February 22, 2015 @08:09PM
(#9092018)
You can have something like this in your .bashrc:
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.
Re:Show HN: Tail out log files from multiple remote hosts wi...
by typicalbender on Sunday February 22, 2015 @12:08PM
(#9090011)
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.
Re:Show HN: Tail out log files from multiple remote hosts wi...
by fidz on Sunday February 22, 2015 @08:35PM
(#9092102)
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).
Serious question - I actually would like to see how you'd do it.
[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://www.gnu.org/software/inetutils/manual/html_node/The-_...
mssh or cluster ssh is also effective in this manner, with the added flexibility of ssh terminals.
[1] - http://www.tecmint.com/using-dsh-distributed-shell-to-run-li...
http://dougmart.in/projects/pagepipe