OpenDMI is a cross-platform, commercial-grade DMI/SMBIOS framework, focused on functionality and ease of use. It provides direct access to all of the DMI/SMBIOS data, command line tools, bindings for major programming languages and even more.
The project is under active development, see ROADMAP and CHANGELOG for details.
- Platform-agnostic access to DMI/SMBIOS structures.
- Full SMBIOS support up to version 3.9.
- Bindings for Python, Go and Rust languages.
- Modular extensions for handling OEM-specific structures.
- JSON, XML and YAML output support for automation purposes.
- Works on Linux, MacOS, Free/Net BSD and Windows platforms.
- Small footprint, no external dependencies.
opendmi- Command line tool to query DMI/SMBIOS dataopendmi-dbus- D-bus service providing access to DMI/SMBIOS datalibopendmi- C library providing direct interface to DMI/SMBIOSlibopendmi-go- Go bindings forlibopendmilibopendmi-python- Python bindings forlibopendmilibopendmi-rust- Rust bindings forlibopendmi
- GCC, CLang or MSVC compiler
- CMake 3.25 or newer
- AsciiDoctor (used to generate documentation and man pages)
- CppCheck (optional)
libxml2— optional, only when XML support is enabledlibyaml— optional, only when YAML support is enabledlibyajl— optional, only when JSON support is enabled
- None
Use the following command to configure OpenDMI build:
$ ./build.sh configureThis produces a release build by default. Pass --debug to configure a debug
build (optimization disabled, debug assertions included):
$ ./build.sh configure --debugTo set the installation prefix:
$ ./build.sh configure --prefix /usr/localTo enable optional components:
$ ./build.sh configure --enable-dbus --enable-pythonTo enable all optional components at once:
$ ./build.sh configure --enable-allTo enable optional format support:
$ ./build.sh configure --with-json --with-xml --with-yamlFor all configuration options, see usage:
$ ./build.sh --helpTo override defaults persistently without modifying build.conf.dist, create a
build.conf file in the project root — settings there take precedence.
Use the following command to build OpenDMI:
$ ./build.sh buildTo build using a specific number of parallel jobs:
$ ./build.sh -j 4 buildTo use a custom build directory:
$ ./build.sh -b /tmp/opendmi-build buildOpenDMI uses the CTest framework for testing. You can simply run it to ensure that build was successful:
$ ./build.sh testTo re-run only the failed tests:
$ ./build.sh test --failedUse the following command to install OpenDMI to the configured prefix:
$ ./build.sh installUse the following command to build distributable packages using CPack:
$ ./build.sh packageTo remove build artifacts without removing the configuration:
$ ./build.sh cleanTo remove the entire build directory including the configuration:
$ ./build.sh distcleanThe opendmi command line tool provides access to DMI/SMBIOS data. The general
usage pattern is:
$ opendmi [global options] <command> [command options]| Option | Description |
|---|---|
-v, --version |
Print version information and exit |
-h, --help |
Print help and exit |
-i, --file=<path> |
Read DMI data from a binary file instead of the system |
-d, --device=<path> |
Set path to memory device (default: /dev/mem) |
-m, --module=<module> |
Enable the specified module |
-l, --log[=<path>] |
Enable logging, optionally to a file |
-L, --log-level=<level> |
Set logging level |
| Command | Description |
|---|---|
show |
Show SMBIOS structures data |
list |
List SMBIOS structures |
entry |
Show SMBIOS entry point data |
types |
List SMBIOS structure types |
explain |
Explain an SMBIOS structure type |
export |
Export SMBIOS data to external format (JSON, XML, YAML) |
dump |
Dump the entire SMBIOS table to a binary file |
modules |
List available modules |
Use opendmi <command> --help for detailed information on a specific command.
Show all SMBIOS structures in human-readable format:
$ opendmi showShow structures of a specific type only:
$ opendmi show -t processorList all structures with their handles and types:
$ opendmi listShow SMBIOS entry point information:
$ opendmi entryExplain a specific structure type:
$ opendmi explain processorExport SMBIOS data to YAML (default format):
$ opendmi export -o smbios.yamlExport SMBIOS data to JSON with pretty-printing:
$ opendmi export -f json --pretty -o smbios.jsonDump the raw SMBIOS table to a binary file:
$ opendmi dump -o smbios.binRead SMBIOS data from a previously saved dump:
$ opendmi -i smbios.bin showThe project is open to contributions. Please feel free to test it and create bug reports, feature requests or pull requests on GitHub. You can also help the project by sending SMBIOS dumps to the authors. To get the dump you can use the following command:
$ dmidecode --dump-bin <filename>Or, using OpenDMI itself:
$ opendmi dump -o <filename>See CONTRIBUTING for more details. A full list of contributors who helped the project so far can be found in the CONTRIBUTORS.
OpenDMI is licensed under BSD 3-clause license. See LICENSE for details. It uses parts of some third-party libraries that are distributed under their own terms (see LICENSE-3RD-PARTY).
PVS-Studio - static analyzer for C, C++, C#, and Java code.