summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats/data/opt/openslx
diff options
context:
space:
mode:
authorSimon Rettberg2019-06-14 15:19:00 +0200
committerSimon Rettberg2019-06-14 15:19:00 +0200
commit79cabf460de34d20af5e58d9ccbccd212470ec02 (patch)
tree8a726578a577699409d6d8775e21e645d4a2c8b3 /core/modules/hardware-stats/data/opt/openslx
parent[nvidia-common] refine kernel module fail detection (diff)
downloadmltk-79cabf460de34d20af5e58d9ccbccd212470ec02.tar.gz
mltk-79cabf460de34d20af5e58d9ccbccd212470ec02.tar.xz
mltk-79cabf460de34d20af5e58d9ccbccd212470ec02.zip
[hardware-stats] Use slx-tools to determine free /tmp
Diffstat (limited to 'core/modules/hardware-stats/data/opt/openslx')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
index 14e08e68..0ddb6159 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
@@ -25,9 +25,9 @@ for SESSION in $(loginctl $LEGEND | awk '{print $1}'); do
done
# Also report usage of /tmp and swap
-TMP=$(df -P /tmp | grep -m1 '^/dev')
-TMP_SIZE=$(echo $TMP | awk '{print $2}')
-TMP_FREE=$(echo $TMP | awk '{print $4}')
+TMP="$( slx-tools fs_path_space /tmp )"
+TMP_FREE="${TMP% *}"
+TMP_SIZE="${TMP#* }"
SWAP_SIZE=$( awk '{if ($1 == "SwapTotal:") { print $2; exit; }}' /proc/meminfo )
SWAP_FREE=$( awk '{if ($1 == "SwapFree:") { print $2; exit; }}' /proc/meminfo )
MEM_SIZE=$( awk '{if ($1 == "MemTotal:") { print $2; exit; }}' /proc/meminfo )