status.sh | 8 +++++++- diff --git a/status.sh b/status.sh index d3eec5b61b1f87e0f08202b02b8128e1666bc787..d0c724378f3216ae9ffc015a149507dd7f295e2f 100755 --- a/status.sh +++ b/status.sh @@ -10,6 +10,9 @@ SGMONDIR="$(dirname "$(realpath -- "$0")")" . "$SGMONDIR"/rc probes="$("$SGMONDIR"/probelist.sh)" +gut=`mktemp` +bad=`mktemp` +trap "rm -fr $gut $bad" HUP PIPE INT QUIT TERM EXIT cat < sgmon status $(date -Iseconds) @@ -24,6 +27,7 @@ [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=1 [ "$attempts" -lt "$max_attempts" ] && status="Prefail" || status="FAIL" status="$status (${attempts}/${max_attempts})" + list=$bad else if [ -r $probe/state/ok ] ; then mtime=$(stat -t "%F %T" -f %Sm $probe/state/ok) @@ -32,8 +36,9 @@ else mtime= status="???" fi + list=$gut fi - cat <>$list < $status $probe @@ -42,4 +47,5 @@
$(catfiles $probe/state/stdout $probe/state/stderr)
EOF done +cat $bad $gut echo ""