From 70172d1ed7f881d513b914d0376ab656d9b5b12b Mon Sep 17 00:00:00 2001 From: Guang Yee Date: Tue, 29 Jan 2019 12:12:21 -0800 Subject: [PATCH] log the output of supportconfig So that we can find out what went wrong if supportconfig is unable to complete successfully. --- scripts/mkcloud | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/mkcloud b/scripts/mkcloud index 637e9212af..78e98e3e68 100755 --- a/scripts/mkcloud +++ b/scripts/mkcloud @@ -221,7 +221,13 @@ function onhost_supportconfig for node in $(crowbar machines list | grep ^d) ; do ( echo "Collecting supportconfig from $node" - timeout 1200 ssh $node supportconfig | wc + SUPPORTCONFIG_OUT=/tmp/supportconfig-output-$node + timeout 1200 ssh $node supportconfig > $SUPPORTCONFIG_OUT 2>&1 + SUPPORTCONFIG_STATUS=$? + echo "$SUPPORTCONFIG_OUT: `wc $SUPPORTCONFIG_OUT`" + if [ $SUPPORTCONFIG_STATUS -ne 0 ]; then + timeout 300 scp $node:$SUPPORTCONFIG_OUT /var/log/ + fi timeout 300 scp $node:/var/log/\*tbz /var/log/ )& done @@ -229,6 +235,7 @@ function onhost_supportconfig wait ' $scp root@$(wrap_ip $adminip):/var/log/*tbz $artifacts_dir/ + $scp root@$(wrap_ip $adminip):/var/log/supportconfig-* $artifacts_dir/ | true fi }