2626from typing import Optional
2727
2828from nodescraper .base import InBandDataCollector
29+ from nodescraper .connection .inband import TextFileArtifact
2930from nodescraper .enums import EventCategory , EventPriority , ExecutionStatus , OSFamily
3031from nodescraper .models import TaskResult
3132
@@ -40,6 +41,7 @@ class DimmCollector(InBandDataCollector[DimmDataModel, DimmCollectorArgs]):
4041
4142 CMD_WINDOWS = "wmic memorychip get Capacity"
4243 CMD = """sh -c 'dmidecode -t 17 | tr -s " " | grep -v "Volatile\\ |None\\ |Module" | grep Size' 2>/dev/null"""
44+ CMD_DMIDECODE_FULL = "dmidecode"
4345
4446 def collect_data (
4547 self ,
@@ -72,6 +74,25 @@ def collect_data(
7274 self .result .message = "Skipping sudo plugin"
7375 self .result .status = ExecutionStatus .NOT_RAN
7476 return self .result , None
77+
78+ # Collect full dmidecode output as artifact
79+ dmidecode_full_res = self ._run_sut_cmd (self .CMD_DMIDECODE_FULL , sudo = True )
80+ if dmidecode_full_res .exit_code == 0 and dmidecode_full_res .stdout :
81+ self .result .artifacts .append (
82+ TextFileArtifact (filename = "dmidecode.txt" , contents = dmidecode_full_res .stdout )
83+ )
84+ else :
85+ self ._log_event (
86+ category = EventCategory .OS ,
87+ description = "Could not collect full dmidecode output" ,
88+ data = {
89+ "command" : dmidecode_full_res .command ,
90+ "exit_code" : dmidecode_full_res .exit_code ,
91+ "stderr" : dmidecode_full_res .stderr ,
92+ },
93+ priority = EventPriority .WARNING ,
94+ )
95+
7596 res = self ._run_sut_cmd (self .CMD , sudo = True )
7697 if res .exit_code == 0 :
7798 total = 0
0 commit comments