Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions inventory/any.cf
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,16 @@ bundle agent cfe_autorun_inventory_dmidecode
"dmi[$(dmivars)]"
unless => isvariable("dmi[$(dmivars)]"),
# This is just for system-uuid really, which we get from the awk script above by preference.
@if minimum_version(3.22.0)
# Some files (e.g. product_serial) are only readable by root.
if => isreadable(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])", 1
),
@else
if => fileexists(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])"
),
@endif
string => readfile(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])", 0
),
Expand Down
Loading