Created
June 15, 2014 16:38
-
-
Save djmaze/f451c646a35736dd95ff to your computer and use it in GitHub Desktop.
Tail on multiple CoreOS servers in parallel
This file contains hidden or 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/sh | |
# | |
# Run like this: | |
# | |
# coreos-multitail.sh core@xxx core@yyy ... | |
SERVERS=($*) | |
echo Tailing ${SERVERS[@]}, press CTRL-C to exit | |
trap ctrl_c int | |
function ctrl_c() { | |
kill 0 | |
} | |
for SERVER in ${SERVERS[@]}; do | |
ssh -n $SERVER "journalctl -f" | awk -F "\n" "{ print \"$SERVER \" \$1 }" & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment