also filter by cpu flags
authorPeter Palfrader <peter@palfrader.org>
Mon, 20 May 2019 10:07:39 +0000 (12:07 +0200)
committerPeter Palfrader <peter@palfrader.org>
Mon, 20 May 2019 10:07:39 +0000 (12:07 +0200)
dsa-nagios-checks/checks/dsa-check-ucode-intel

index 33f3c88..5d03b52 100755 (executable)
@@ -23,7 +23,8 @@
 
 
 cpu_sig="$(iucode_tool --scan-system 2>&1 | sed -e 's/.*with signature //')"
-avail_line="$(iucode_tool -l  -S -tb /lib/firmware/intel-ucode 2>&1 | grep "sig[[:space:]]*$cpu_sig")"
+cpu_flags="$(cat /sys/devices/system/cpu/cpu0/microcode/processor_flags)"
+avail_line="$(iucode_tool -l -s "$cpu_sig,$cpu_flags" -tb /lib/firmware/intel-ucode 2>&1 | grep "sig[[:space:]]*$cpu_sig")"
 avail="$(echo "$avail_line" | sed -e 's/.*rev[[:space:]]*//; s/[,[:space:]].*//')"
 
 if [ -z "$avail" ]; then