Created
May 18, 2015 01:58
-
-
Save fujiwara/dc4309d3866e3c47abe8 to your computer and use it in GitHub Desktop.
multitail-consul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
node="$1" | |
cmd="$2" | |
nodes=$(consul members -status alive | awk "/$node/{ print \$1 }") | |
args=() | |
for n in $nodes | |
do | |
args=("${args[@]}" "-L") | |
args=("${args[@]}" "ssh $n $cmd") | |
done | |
multitail --mergeall "${args[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment