summaryrefslogtreecommitdiffstats
path: root/server/ipxe
diff options
context:
space:
mode:
authorJannik Schönartz2018-12-11 13:59:50 +0100
committerJannik Schönartz2018-12-11 13:59:50 +0100
commitcee759da4149a1681a89e10cc849a0cadff3bf2d (patch)
treec964e9a5f9eaac708604851816dded24475e6910 /server/ipxe
parent[groups,clients,configurator] api rework to the new format (diff)
downloadbas-cee759da4149a1681a89e10cc849a0cadff3bf2d.tar.gz
bas-cee759da4149a1681a89e10cc849a0cadff3bf2d.tar.xz
bas-cee759da4149a1681a89e10cc849a0cadff3bf2d.zip
[registration/idoit] TPM upload functionality + improve hw specs
Improved IdoIT hw specs capture. Including multiple ram slots. Set purpose of the automatic registration to Pool PC. Added upload files to idoit for uploading the tpm and ssl key.
Diffstat (limited to 'server/ipxe')
-rw-r--r--server/ipxe/grepSystemInfo.sh24
-rw-r--r--server/ipxe/registration.ipxe2
2 files changed, 23 insertions, 3 deletions
diff --git a/server/ipxe/grepSystemInfo.sh b/server/ipxe/grepSystemInfo.sh
index 2f8e6cc..a0810be 100644
--- a/server/ipxe/grepSystemInfo.sh
+++ b/server/ipxe/grepSystemInfo.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-
+# http://git.openslx.org/openslx-ng/mltk.git/tree/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
#dmidecode | grep -i UUID
# MAC
@@ -30,6 +30,7 @@ CPU_CORES=$(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sor
#CPUMODEL=$(grep -m1 '^model name\s*:' /proc/cpuinfo | sed 's/^model name\s*:\s*//;s/\s\s*/ /g;s/^ //;s/ $//')
#echo "$CPUMODEL"
CPU_FREQUENCY=$(dmidecode -q -s processor-frequency)
+CPU_FREQUENCY=${CPU_FREQUENCY%" MHz"}
# RAM
# RAM=$(grep -m1 '^MemTotal:' /proc/meminfo | awk '{print $2}')
@@ -42,6 +43,25 @@ CPU_FREQUENCY=$(dmidecode -q -s processor-frequency)
# done
# fi
+# RAM_SIZE=$(dmidecode -t 17 | grep -o 'Size:.*[MG]B$')
+RAM_SIZE=$(dmidecode -t 17 | grep -o 'Size:.*')
+RAM_MANUFACTURER=$(dmidecode -t 17 | grep -o 'Manufacturer:.*')
+#RAM_MANUFACTURER=${RAM_MANUFACTURER#"\tManufacturer: "}
+RAM_TYPE=$(dmidecode -t 17 | grep -o 'Type:.*')
+RAM_ISECC=$(dmidecode -t 16 | grep -o 'Error Correction Type:.*')
+RAM_FORMFACTOR=$(dmidecode -t 17 | grep -o 'Form Factor:.*')
+#RAM_TYPE=${RAM_TYPE#"\tType: "}
+
+# HDD / SSD
+# hd parm or smartctl from smartmontools
+drives=$(ls /dev/sd* | grep -o '/dev/sd.$')
+for drive in $drives; do
+ # drivedata=$(sudo smartctl -i $drive)
+ # drivedata=$(sudo hdparm -I $drive)
+ # echo $drivedata | grep -o 'Device Model: .*'
+done
+
+
# Curl
#curl --data "state=6" --insecure https://bas.stfu-kthx.net:8888/api/registrations/$UUID/state
-curl -d "uuid=$UUID&name=Client_$UUID&sys_manufacturer=$MANUFACTURER&sys_model=$MODEL&sys_serial=$SERIAL&cpu_model=$CPU_MODEL&cpu_manufacturer=$CPU_MANUFACTURER&cpu_type=$CPU_TYPE&cpu_cores=$CPU_CORES&cpu_frequency=$CPU_FREQUENCY" -H "Content-Type: application/x-www-form-urlencoded" -X POST https://bas.intra.uni-freiburg.de/api/registrations/$UUID/update
+curl -d "name=Client_$UUID&sys_manufacturer=$MANUFACTURER&sys_model=$MODEL&sys_serial=$SERIAL&cpu_model=$CPU_MODEL&cpu_manufacturer=$CPU_MANUFACTURER&cpu_type=$CPU_TYPE&cpu_cores=$CPU_CORES&cpu_frequency=$CPU_FREQUENCY&ram_size=$RAM_SIZE&ram_manufacturer=$RAM_MANUFACTURER&ram_type=$RAM_TYPE&ram_isecc=$RAM_ISECC&ram_formfactor=$RAM_FORMFACTOR" -H "Content-Type: application/x-www-form-urlencoded" -X POST --insecure https://bas.intra.uni-freiburg.de/api/registrations/$UUID/update
diff --git a/server/ipxe/registration.ipxe b/server/ipxe/registration.ipxe
index a20beda..c7fa24c 100644
--- a/server/ipxe/registration.ipxe
+++ b/server/ipxe/registration.ipxe
@@ -24,10 +24,10 @@ goto start
:automatic
params
-param name unnamed
param mac ${net0/mac}
param uuid ${uuid}
param ip ${net0/ip}
+param purpose Pool PC
chain https://bas.intra.uni-freiburg.de/api/registrations/add##params
:manual