diff --git a/cmk/plugins/collection/agent_based/inventory_lnx_video.py b/cmk/plugins/collection/agent_based/inventory_lnx_video.py index 85ab5f28532..2d727e08548 100644 --- a/cmk/plugins/collection/agent_based/inventory_lnx_video.py +++ b/cmk/plugins/collection/agent_based/inventory_lnx_video.py @@ -29,6 +29,7 @@ @dataclass class GraphicsCard: + slot: str name: str subsystem: str | None = None driver: str | None = None @@ -46,14 +47,15 @@ def parse_lnx_video(string_table: StringTable) -> Section: continue if "VGA compatible controller" in line[-2]: + current_slot = ":".join(line).split()[0] current_name = line[-1].strip() if current_name: - parsed_section.setdefault(current_name, GraphicsCard(name=current_name)) + parsed_section.setdefault(current_slot, GraphicsCard(slot=current_slot, name=current_name)) elif current_name: if line[0] == "Subsystem": - parsed_section[current_name].subsystem = line[1].strip() + parsed_section[current_slot].subsystem = line[1].strip() elif line[0] == "Kernel driver in use": - parsed_section[current_name].driver = line[1].strip() + parsed_section[current_slot].driver = line[1].strip() return parsed_section @@ -70,9 +72,10 @@ def inventory_lnx_video(section: Section) -> InventoryResult: yield TableRow( path=["hardware", "video"], key_columns={ - "name": graphics_card.name, + "slot": graphics_card.slot, }, inventory_columns={ + "name": graphics_card.name, "subsystem": graphics_card.subsystem, "driver": graphics_card.driver, },