[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: jenkins-shell-monitor: also monitor diskusage of /var/lib/schroot (and use sudo for that)

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Feb 17 23:05:38 GMT 2023



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


Commits:
1ba6acdd by Holger Levsen at 2023-02-17T23:56:11+01:00
jenkins-shell-monitor: also monitor diskusage of /var/lib/schroot (and use sudo for that)

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

- - - - -
9ba71d0c by Holger Levsen at 2023-02-18T00:05:20+01:00
jenkins-shell-monitor: also monitor diskusage of /var/lib/jenkins and /srv/schroots

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

- - - - -


1 changed file:

- bin/jenkins-shell-monitor.sh


Changes:

=====================================
bin/jenkins-shell-monitor.sh
=====================================
@@ -57,18 +57,18 @@ main_loop() {
 			fi
 			printf  "%-45s %-5s %-${WIDTH}s %s\n" $FILESYSTEM_MOUNTPOINT $FILESYSTEM_SIZE $FILESYSTEM_AVAIL $FILESYSTEM_USAGE
 			# include some directory stats which have been problematic in the past
+			WIDTH=5
 			case $FILESYSTEM in
 				"/dev/vda1")
-					DIR_PATH=/srv/reproducible-results/rbuild-debian
-					DU=$(du -sh $DIR_PATH 2>/dev/null | awk '{ print $1 }')
-					if [ -n "$(echo $DU | grep -E '[0-9]{3}G')" ] ; then
-						DIR_USAGE="${YELLOW}$DU${FOREGROUND_COLOR}"
-						WIDTH=16
-					else
-						DIR_USAGE=$DU
-						WIDTH=5
-					fi
-					printf  "%-45s %-5s %-${WIDTH}s %s\n" "  $DIR_PATH" "" "" $DIR_USAGE
+					for DIR_PATH in /var/lib/jenkins /var/lib/schroot /srv/schroots /srv/reproducible-results/rbuild-debian ; do
+						DU=$(sudo du -shx $DIR_PATH 2>/dev/null | awk '{ print $1 }')
+						if [ -n "$(echo $DU | grep -E '[0-9]{3}G')" ] ; then
+							DIR_USAGE="${YELLOW}$DU${FOREGROUND_COLOR}"
+						else
+							DIR_USAGE=$DU
+						fi
+						printf  "%-45s %-5s %-${WIDTH}s %s\n" "  $DIR_PATH" "" "" $DIR_USAGE
+					done
 					;;
 				"/var/lib/jenkins/userContent/reproducible")
 					DIR_PATH=/var/lib/jenkins/userContent/reproducible/debian



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/6479fc79e55a14dce01a9cd8ddaccaf2ec1be305...9ba71d0cdda638ea9a64d121d809a48a808b741a

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/6479fc79e55a14dce01a9cd8ddaccaf2ec1be305...9ba71d0cdda638ea9a64d121d809a48a808b741a
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/20230217/67436ef2/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list