summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-17 17:12:25 +0200
committerSimon Rettberg2016-10-17 17:12:25 +0200
commit0d5cee2960f8c8c1bf133931733939ff0e6f1a73 (patch)
tree24bf7cd757484d6ec4000365e73636d90a39808f
parent[dnbd3] Explicitly state dnbd3 components to build (diff)
downloadtm-scripts-0d5cee2960f8c8c1bf133931733939ff0e6f1a73.tar.gz
tm-scripts-0d5cee2960f8c8c1bf133931733939ff0e6f1a73.tar.xz
tm-scripts-0d5cee2960f8c8c1bf133931733939ff0e6f1a73.zip
[hardware-stats] Fix /tmp check...
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update4
1 files 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."