summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats
diff options
context:
space:
mode:
authorSimon Rettberg2021-01-25 15:56:48 +0100
committerSimon Rettberg2021-01-25 15:57:16 +0100
commitbc0f0ea717a1be0836f15db0815c92863aa59a69 (patch)
tree0d18ae23d4de5e846659ab20c6c02a3c41034996 /core/modules/hardware-stats
parent[run-virt] Add sec= option to mount-script (diff)
downloadmltk-bc0f0ea717a1be0836f15db0815c92863aa59a69.tar.gz
mltk-bc0f0ea717a1be0836f15db0815c92863aa59a69.tar.xz
mltk-bc0f0ea717a1be0836f15db0815c92863aa59a69.zip
[hardware-stats] Add ID45 to status updates
References #3634
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update12
1 files changed, 11 insertions, 1 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 5b8362e8..cd60c080 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
@@ -30,11 +30,20 @@ for SESSION in $(loginctl $LEGEND | awk '{print $1}'); do
unset Name
done
+. "$( which slx-tools )"
# Also report usage of /tmp and swap
-TMP="$( slx-tools fs_path_space /tmp )"
+TMP="$( fs_path_space /tmp )"
TMP_FREE="${TMP% *}"
TMP_SIZE="${TMP#* }"
+PERSISTENT_SIZE=0
+PERSISTENT_FREE=0
+if fs_path_ismountpoint /opt/openslx/persistent; then
+ TMP="$( fs_path_space /opt/openslx/persistent )"
+ ID45_FREE="${TMP% *}"
+ ID45_SIZE="${TMP#* }"
+fi
+
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 )
@@ -72,6 +81,7 @@ fi
curl --retry 3 --retry-connrefused -m 6 -s --data-urlencode "type=~runstate" --data-urlencode "uuid=$UUID" --data-urlencode "used=$USED" \
--data-urlencode "user=$Name" --data-urlencode "tmpsize=$TMP_SIZE" --data-urlencode "tmpfree=$TMP_FREE" \
+ --data-urlencode "id45size=$ID45_SIZE" --data-urlencode "id45free=$ID45_FREE" \
--data-urlencode "swapsize=$SWAP_SIZE" --data-urlencode "swapfree=$SWAP_FREE" \
--data-urlencode "memsize=$MEM_SIZE" --data-urlencode "memfree=$MEM_FREE" \
"$@" \