summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats/data/opt/openslx
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/hardware-stats/data/opt/openslx')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info6
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report17
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings2
3 files changed, 10 insertions, 15 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info
index ae35b33a..545cb4bc 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-gather_hw_info
@@ -9,8 +9,8 @@
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
-declare -rg REPORTFILE="/run/hwreport"
-declare -rg jsonfile="/run/hwreport.json"
+declare -rg REPORTFILE="/run/openslx/hwreport"
+declare -rg jsonfile="/run/openslx/hwreport.json"
# new json-based reporting, run first in background and wait at the end of script
# This is only supported by Sat3.11, released 12-2023, so keep creating the old format
@@ -292,7 +292,7 @@ echo "Created report file"
################################################################################
# Save information to local file for later use
#
-cat > "/run/hwinfo" <<HORST
+cat > "/run/openslx/hwinfo" <<HORST
HW_KVM='${VT}'
HW_ID44='${ID44}'
HW_MAC='${MAC}'
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report
index 64d0f090..bf1fe6ee 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_report
@@ -8,23 +8,21 @@ disable_remote_logging() {
}
# sends the hardware information of this machine generated by
-# systemd-hardware_stats_gather in /run/hwreport and /run/hwinfo
+# systemd-hardware_stats_gather in /run/openslx/hwreport and /run/openslx/hwinfo
report_hardware_info() {
local uptime hwreport hwinfo uuid model subnet ret runmode jsonfile
if [ -z "$SLX_REMOTE_LOG" ]; then
disable_remote_logging
return 1
fi
- hwreport="/run/hwreport"
- jsonfile="/run/hwreport.json"
+ hwreport="/run/openslx/hwreport"
+ jsonfile="/run/openslx/hwreport.json"
if ! [ -s "$hwreport" ] && ! [ -s "$jsonfile" ]; then
echo "Missing hwreport file: $hwreport AND $jsonfile"
- # TODO send data without?
- return 1
fi
# Read generated data and current uptime and send it
- hwinfo="/run/hwinfo"
+ hwinfo="/run/openslx/hwinfo"
if [ ! -s "$hwinfo" ]; then
echo "Missing hwinfo file: $hwinfo"
return 1
@@ -80,8 +78,8 @@ report_hardware_info() {
fi
echo "succeeded."
rm -f -- "$hwreport" "$jsonfile"
- START=$(( $RANDOM % 5 ))
- DELAY=$(( $RANDOM % 20 ))
+ START=$(( RANDOM % 5 ))
+ DELAY=$(( RANDOM % 20 ))
# Do not move/rename this file, we check its existence in other scripts
cat > "/etc/cron.d/usage_stats" <<-EOF
# Update usage statistics on server
@@ -90,9 +88,6 @@ report_hardware_info() {
${START}-59/5 * * * * root sleep ${DELAY}; /opt/openslx/scripts/cron-system_usage_update --full
EOF
- # TODO remove this hack one day: Sometimes, aufs doesn't update the mtime of dirs
- # when creating files, so cron would not rescan the cron directory.
- touch "/etc/cron.d"
# Trigger right now so resource usage gets updated
/opt/openslx/scripts/cron-system_usage_update --full
return 0
diff --git a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings
index 3e8f8210..627b94fd 100755
--- a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings
+++ b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-warnings
@@ -3,7 +3,7 @@
# If a first parameter is given, we write to that file instead of stdout.
. /opt/openslx/config
-. /run/hwinfo
+. /run/openslx/hwinfo
if [ -n "$1" ]; then
exec >> "$1"