Add pci slot as unique key to vga card inventory
General information
The hardware inventory uses the graphic card name as unique key. If multiple cards with the same name are present only one card is inventorized. The section already includes the PCI slot which would be a better key to the dictionary of present graphic cards.
Bug reports
See https://forum.checkmk.com/t/linux-inventory-plugin-shows-one-card-of-such-type-but-server-has-eight/55985
To reproduce
- Start Docker container checkmk/check-mk-raw:2.4.0-latest (currently Checkmk Raw Edition 2.4.0p13)
- Create dummy plugin (e.g. /usr/lib/check_mk_agent/plugins/vga) to represent multiple video cards in this container:
#!/bin/bash
cat <<EOF
<<<lnx_video:sep(58)>>>
00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 200b
Kernel driver in use: hyperv_drm
00:08.1 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 200c
Kernel driver in use: hyperv_drm
00:08.2 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 200d
Kernel driver in use: hyperv_drm
00:08.3 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 200e
Kernel driver in use: hyperv_drm
05:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cape Verde PRO [Radeon HD 7700 Series] (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 200b
Kernel driver in use: fglrx_pci
EOF
- add localhost as host in CheckMK
- look at the inventory of localhost: only 2 instead of 5 expected graphic cards are listed
Proposed changes
Add the PCI slot to the inventory and use slot instead of name as key in the internal dictionary.
Thank you for your contribution. This pull request has been marked as stale as it has not passed the automated tests and there was no activity for the last 14 days. Please take a look at the ‘Checks’ section for details on the test results and make the necessary changes.
This pull request will be closed due to inactivity after 60 days, if no action is taken.
A CI check failed during setup. Can this be retriggered without an additional commit?
Is this fixable in test-format:
ERROR: /home/runner/work/checkmk/checkmk/bazel/tools/format/BUILD:56:16: //bazel/tools/format:format_C++_with_clang-format.check depends on @@llvm_linux_x86_64+//:bin/clang-format in repository @@llvm_linux_x86_64+ which failed to fetch. no such package '@@llvm_linux_x86_64+//': java.io.IOException: Error extracting /home/runner/.cache/bazel/_bazel_runner/aed53f964069daa6ab471b6b9883c077/external/llvm_linux_x86_64+/temp2722159911779553489/LLVM-19.1.7-Linux-X64.tar.xz to /home/runner/.cache/bazel/_bazel_runner/aed53f964069daa6ab471b6b9883c077/external/llvm_linux_x86_64+/temp2722159911779553489: write (No space left on device)