From 61909258a0fbbc8fb11cd1e11498fb4a2f4ae85b Mon Sep 17 00:00:00 2001 From: Swapnil Date: Tue, 25 Jun 2024 17:45:07 +0530 Subject: [PATCH] Added RAM info in notes --- agent.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/agent.py b/agent.py index fc3a8ad..52a60f8 100644 --- a/agent.py +++ b/agent.py @@ -179,8 +179,18 @@ class ServerData: processor_model = processor_info[0].get('Version', 'Unknown') if processor_info else 'Unknown' processor_count = len(processor_info) + ram_info = [section for section in self.dmidecode_data if section['DMIType'] == 17] + ram_details = [] + for ram in ram_info: + size = ram.get('Size', 'Unknown') + speed = ram.get('Speed', 'Unknown') + ecc = 'Yes' if ram.get('Total Width') == '72 bits' and ram.get('Data Width') == '64 bits' else 'No' + serial_number = ram.get('Serial Number', 'Unknown') + ram_type = ram.get('Type', 'Unknown') + ram_details.append("Size: {}, Speed: {}, ECC: {}, Serial Number: {}, Type: {}".format(size, speed, ecc, serial_number, ram_type)) + note = "Chassis Model: {} | Serial Number: {} ||| Processor Model: {} | Count: {} ||| RAM Details: {}".format( - chassis_model, chassis_serial, processor_model, processor_count, '\n'.join(['R1', 'R2', 'R3'])) + chassis_model, chassis_serial, processor_model, processor_count, ' | '.join(ram_details)) note_data = { 'note': note,