also filter by cpu flags
[mirror/dsa-nagios.git] / 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