Created
May 27, 2014 21:00
-
-
Save gene1wood/1b0d5a8f7c12910a28e0 to your computer and use it in GitHub Desktop.
Tail the chef log across multiple hosts in parallel, exiting when the chef run completes
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
stack=1234 | |
hostlist="`get_hosts $stack`" | |
pssh -O StrictHostKeyChecking=no \ | |
--print \ | |
--user ec2-user \ | |
--host "$hostlist" \ | |
--timeout=0 \ | |
--par=20 \ | |
'while true; do if ! tail -1 /var/log/chef.log | sed -e "s/^/`hostname`/" | grep -v "`date +%Y-%m-%d`.*Report handlers complete"; then tail -1 /var/log/chef.log | grep "`date +%Y-%m-%d`.*Report handlers complete"; break; fi; sleep 2; done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment