export
Description
The export command writes the decoded SMBIOS structures in a machine-readable format, so that the data can be consumed by something other than a reader of the terminal.
Fields are named by their codes rather than by their labels, e.g.
socket-designation instead of Socket Designation, and enumerated values are
written as codes as well. Codes are stable across versions and locales, so the
output can be matched against without parsing human-readable text. --pretty
writes the values for a person instead, leaving the field names alone.
The formats available depend on how the utility was built, since each of them needs a library of its own. The formats of a particular build are listed at the end of its --help output.
Which structures are exported is decided by the filter options, which are
common to opendmi-show and opendmi-list. By default the standard and
the OEM-specific structures are exported, and the inactive and the unknown ones
are not.
Options
- -?, -h, --help
-
Print help and exit.
- -o path, --output=path
-
Write the output to the named file instead of the standard output.
- -f format, --format=format
-
Set the output format:
text,json,xmloryaml. The default isyaml. - -D, --dump
-
Export the raw bytes of the structures instead of decoding them.
- -p, --pretty
-
Write the values the way a person reads them, as
opendmi-showprints them, instead of by their codes:DDR4rather thanddr4,4 GiBrather than4294967296, and the measurement unit of a field along with its number. Field names stay codes either way, so that the document can still be addressed by them, and the text format is unaffected, since it is already what the option asks the other formats for. - -F, --force
-
Overwrite the output file if it exists. Without this option an existing file is left alone and the command fails.
- -A, --anonymize
-
Replace the values identifying the system, e.g. serial numbers, asset tags, UUIDs and MAC addresses, so that the document can be shared. The values are replaced the way opendmi dump --anonymize replaces them, see
opendmi-dump, and the structures are exported with the replaced values. The command fails with the global --overlay option.
Filter options
- -H handle, --handle=handle
-
Only export the structures with the given handle, which is read as a hexadecimal number, with or without the
0xprefix. The option may be given several times. - -t type, --type=type
-
Only export the structures of the given type, which is either a number or a code name, e.g.
4orprocessor. The option may be given several times. Seeopendmi-typesfor the types and their codes. - -s, --standard
-
Export the structures of the types the specification defines.
- -S, --no-standard
-
Do not export the structures of the types the specification defines.
- -e, --oem
-
Export the OEM-specific structures, which are the ones of types 128 to 255.
- -E, --no-oem
-
Do not export the OEM-specific structures.
- -i, --inactive
-
Export the structures which the firmware has marked as inactive (type 126).
- -I, --no-inactive
-
Do not export the inactive structures.
- -u, --unknown
-
Export the structures of the types no enabled module describes, which are left as raw data.
- -U, --no-unknown
-
Do not export the structures of the unknown types.
- -m module, --module=module
-
Only export the structures described by the named module, whatever type numbers the platform places them at. The module has to be enabled, either for the platform or with the global --module option, or else nothing it describes is decoded. The option may be given several times.
- -M, --all-modules
-
Only export the structures described by the enabled modules.
- -a, --all
-
Export every structure, including the inactive and the unknown ones.
Exit status
- 0
-
Data has been exported.
- 1
-
Data could not be read or written, e.g. the output file exists and --force was not given.
- 2
-
Command line is invalid.
Examples
Export everything to YAML, which is the default format:
$ opendmi export -o smbios.yaml
Export to YAML with serial numbers, asset tags, UUIDs and MAC addresses replaced, to be attached to a bug report:
$ opendmi export --anonymize -o smbios.yaml
Export to JSON with the values written for a person rather than for a program:
$ opendmi export -f json --pretty -o smbios.json
Export the processors alone, and read a field out of the result:
$ opendmi export -f json -t processor |
jq '.table[].attributes."socket-designation"'