From 0d5cee2960f8c8c1bf133931733939ff0e6f1a73 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 17 Oct 2016 17:12:25 +0200 Subject: [hardware-stats] Fix /tmp check... --- .../hardware-stats/data/opt/openslx/scripts/cron-system_usage_update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update index 38f1deb9..df8dab45 100755 --- a/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update +++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update @@ -22,7 +22,7 @@ for SESSION in $(loginctl | awk '{print $1}'); do done # Also report usage of /tmp and swap -TMP=$(df -P /tmp | grep -m1 ^/tmp) +TMP=$(df -P /tmp | grep -m1 ' /tmp$') TMP_SIZE=$(echo $TMP | awk '{print $2}') TMP_FREE=$(echo $TMP | awk '{print $4}') SWAP_FREE=$(grep -m1 ^SwapFree: /proc/meminfo | awk '{print $2}') @@ -38,7 +38,7 @@ if [ "$SWAP_FREE" -gt 0 ] && [ "$SWAP_FREE" -lt 500000 ]; then # less than 500MB Der Arbeitsspeicher des Computers ist fast voll. The computer is running out of RAM." fi -if [ "$TMP_FREE" -lt 500000 ]; then +if [ -n "$TMP_FREE" ] && [ "$TMP_FREE" -lt 500000 ]; then WARN="$WARN Es verbleibt wenig temporärer Speicher für die Arbeitsdaten der laufenden VM. Little temporary storage is left for the current VM." -- cgit v1.2.3-55-g7522