Skip to content

Commit 0735ab7

Browse files
authored
Fix CPU type discovery on aarch processors (#6325)
These don't have a model number in cpuinfo Signed-off-by: Tim Smith <tsmith84@gmail.com>
1 parent 7fd94a3 commit 0735ab7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

content/mondoo-linux-inventory.mql.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,16 @@ packs:
109109
mql: machine.baseboard.product
110110
- uid: mondoo-linux-cpu-type
111111
title: CPU type
112+
filters: mondoo.capabilities.contains("run-command")
112113
mql: |
113-
file("/proc/cpuinfo").content.lines.where(_.contains("model name")).first().split(":").last().trim()
114+
if (asset.arch == /aarch/) {
115+
command("lscpu").stdout.lines.where(_.contains("Model name")).first().split(":").last().trim()
116+
} else {
117+
file("/proc/cpuinfo").content.lines.where(_.contains("model name")).first().split(":").last().trim()
118+
}
114119
- uid: mondoo-linux-root-volume
115120
title: Root volume size and filesystem type
121+
filters: mondoo.capabilities.contains("run-command")
116122
mql: |
117123
command("df -TH / | awk '{ print $3 "+'" "'+" $2 }'").stdout.trim
118124
- uid: mondoo-linux-physical-memory

0 commit comments

Comments
 (0)