diff options
author | Simon Rettberg | 2019-11-26 12:08:11 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-26 12:08:11 +0100 |
commit | cacc21a3ef61f2001ae1a860566fac6d0f8733ab (patch) | |
tree | 1976ccc989dd4c887e2294ea888db3cd03bea489 /core/modules/hardware-stats | |
parent | [hardware-stats] Fix whitespace (diff) | |
download | mltk-cacc21a3ef61f2001ae1a860566fac6d0f8733ab.tar.gz mltk-cacc21a3ef61f2001ae1a860566fac6d0f8733ab.tar.xz mltk-cacc21a3ef61f2001ae1a860566fac6d0f8733ab.zip |
[hardware-stats] Report IP/subnet size too
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report | 4 |
1 files changed, 3 insertions, 1 deletions
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 dcb35ac2..a17e9ead 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 @@ -45,13 +45,15 @@ report_hardware_info() { if [ "$HW_MANUF" != "Unknown" ]; then model="$model ($HW_MANUF)" fi + # Get IP/subnet size + local subnet="$( ip -o -f inet addr show br0 | awk '/scope global/ {print $4}' )" # just assume the uuid/mac dumped are valid here (its checked often enough :)) 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 "kvmstate=$HW_KVM" --data-urlencode "cpumodel=$HW_CPUMODEL" --data-urlencode "id44mb=$HW_ID44" \ - --data-urlencode "badsectors=$HW_BADSECTORS" --data-urlencode "systemmodel=$model" \ + --data-urlencode "badsectors=$HW_BADSECTORS" --data-urlencode "systemmodel=$model" --data-urlencode "subnet=$subnet" \ --data-urlencode "data@$hwreport" "$SLX_REMOTE_LOG" | grep -q "RESULT=0" local ret=$? if [ "$ret" -ne 0 ]; then |