[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] jenkins shell monitor: only show offline node section if there are offline nodes

Holger Levsen (@holger) gitlab at salsa.debian.org
Sun Jan 16 01:17:00 GMT 2022



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
7a3e34ae by Holger Levsen at 2022-01-16T02:16:53+01:00
jenkins shell monitor: only show offline node section if there are offline nodes

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/jenkins-shell-monitor.sh


Changes:

=====================================
bin/jenkins-shell-monitor.sh
=====================================
@@ -109,15 +109,19 @@ main_loop() {
 		fi
 		echo "=== jenkins/trbo shell monitor ==="
 		echo
-		echo "relevant lines from ~jenkins/offline_nodes:"
-		grep -A 2342 Also ~jenkins/offline_nodes | sed '/^$/d' | sed  "/^#/! s/^/$YELLOW/g" | sed  "/^#/! s/$/$FOREGROUND_COLOR/g" | grep -v "nvestigation needed" | grep -v "Down here nodes" | grep -v "failing their health check"
+		OFFLINE_NODES=$(grep -A 2342 Also ~jenkins/offline_nodes | sed '/^$/d' | sed  "/^#/! s/^/$YELLOW/g" | sed  "/^#/! s/$/$FOREGROUND_COLOR/g" | grep -v "nvestigation needed" | grep -v "Down here nodes" | grep -v "failing their health check")
 		# ^^^ this line explained:
 		# we grep for everything after the string 'Also" because we know the document and this will never change... m( :)
 		# the first sed command removes empty lines
 		# the second sed command replaces the beginning of non-matching lines with $YELLOW
 		# the third sed puts back the original foreground color..
 		# and then we filter out some lines.
-		echo
+		if [ $(echo -e "$OFFLINE_NODES" | wc -l) -gt 1 ] ; then
+			echo "relevant lines from ~jenkins/offline_nodes:"
+			echo
+			echo -e "$OFFLINE_NODES"
+			echo
+		fi
 		figlet $(cat ~/userContent/reproducible/trbo.status) 
 		echo " ^^^ trbo status, see https://tests.reproducible-builds.org/trbo.status.html"
 		echo



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/7a3e34ae7cfabef4944f2368aa092da259f68df7

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/7a3e34ae7cfabef4944f2368aa092da259f68df7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20220116/86e9a543/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list