diff options
author | Simon Rettberg | 2021-09-28 15:33:42 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-09-28 15:33:42 +0200 |
commit | e9faa2510a774567decaf7682f8dc78437bbb607 (patch) | |
tree | 908cae8c9725821864c6871dd402a39f125847f5 /core | |
parent | [redsocks] Always blacklist satellite.bwlehrpool (diff) | |
download | mltk-e9faa2510a774567decaf7682f8dc78437bbb607.tar.gz mltk-e9faa2510a774567decaf7682f8dc78437bbb607.tar.xz mltk-e9faa2510a774567decaf7682f8dc78437bbb607.zip |
[hardware-stats] Add threads and sockets to hw-report
Diffstat (limited to 'core')
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 6 | ||||
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index dd334cc7..c66af2fa 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -92,6 +92,7 @@ echo "Determined MAC=$MAC" VCORES=$(grep '^processor\s' /proc/cpuinfo | sort -u | wc -l) # Real cores CPUCORES=$(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sort -u | wc -l) +CPUSOCKETS=$(grep '^physical id' /proc/cpuinfo | sort -u | wc -l) # Fallback 1... if [ -z "$CPUCORES" ] || [ "$CPUCORES" = "0" ]; then for c in $(dmidecode -t 4 | grep 'Core Enabled' | awk -F ':' '{print $2}'); do @@ -100,7 +101,7 @@ if [ -z "$CPUCORES" ] || [ "$CPUCORES" = "0" ]; then fi # Fallback 2... if [ -z "$CPUCORES" ] || [ "$CPUCORES" = "0" ]; then - CPUCORES=$(grep -E -e '^core id\s*:' -e '^physical\s*:' /proc/cpuinfo | xargs -l2 echo | sort -u | wc -l) + CPUCORES=$(grep -E -e '^core id\s*:' -e '^physical id\s*:' /proc/cpuinfo | xargs -l2 echo | sort -u | wc -l) fi echo "$CPUCORES real cores, $VCORES with HT" @@ -266,7 +267,7 @@ HW_MODEL=$(bashesc "$HW_MODEL") REPORTFILE="/run/hwreport" cat > "$REPORTFILE" <<-EOF ############################### CPU ##################################### -Sockets: $(grep '^physical id' /proc/cpuinfo | sort -u | wc -l) +Sockets: $CPUSOCKETS Real cores: $CPUCORES Virtual cores: $VCORES ######################## Partition tables ############################### @@ -306,6 +307,7 @@ HW_BADSECTORS='${BADSECTORS}' HW_MANUF='${HW_MANUF}' HW_MODEL='${HW_MODEL}' HW_CPUMODEL='${CPUMODEL}' +HW_SOCKETS='${CPUSOCKETS}' HW_CORES='${CPUCORES}' HW_THREADS='${VCORES}' HORST diff --git a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report index 3fd9ffe5..09d8efc9 100755 --- a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report +++ b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report @@ -62,7 +62,8 @@ report_hardware_info() { echo -n "Submitting to '$SLX_REMOTE_LOG' ... " curl --retry 4 --retry-connrefused --max-time 5 --retry-max-time 15 \ --data-urlencode "type=~poweron" --data-urlencode "uuid=$uuid" --data-urlencode "macaddr=$HW_MAC" \ - --data-urlencode "uptime=$uptime" --data-urlencode "realcores=$HW_CORES" --data-urlencode "mbram=$HW_MBRAM" \ + --data-urlencode "uptime=$uptime" --data-urlencode "realcores=$HW_CORES" --data-urlencode "vcores=$HW_THREADS" \ + --data-urlencode "sockets=$HW_SOCKETS" --data-urlencode "mbram=$HW_MBRAM" \ --data-urlencode "kvmstate=$HW_KVM" --data-urlencode "cpumodel=$HW_CPUMODEL" --data-urlencode "id44mb=$HW_ID44" \ --data-urlencode "badsectors=$HW_BADSECTORS" --data-urlencode "systemmodel=$model" --data-urlencode "subnet=$subnet" \ --data-urlencode "runmode=$runmode" --data-urlencode "data@$hwreport" --data-urlencode "json@$jsonfile" \ |