From 261f6e66822618a57333d35cfa5c91714506fa31 Mon Sep 17 00:00:00 2001 From: Daniel With Date: Fri, 7 Mar 2025 12:09:49 -0600 Subject: [PATCH] Feat: Adding fields to megaraid_pd_info Prometheus exporter data Added to additional keys: - manufacturer - type (JBOD or "-") This tells us whether the drive is being tracked by the RAID card as part of an array or strictly in pass through mode which is designated for JBOD. Both of these fields will assist in filters with Prometheus alert rules. --- ansible/playbooks/extra/custom_exporters/perccli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/extra/custom_exporters/perccli.py b/ansible/playbooks/extra/custom_exporters/perccli.py index 2c6eb9590..8d386f73a 100644 --- a/ansible/playbooks/extra/custom_exporters/perccli.py +++ b/ansible/playbooks/extra/custom_exporters/perccli.py @@ -213,6 +213,8 @@ "state", "firmware", "serial", + "manufacturer", + "type", ], namespace=namespace, registry=registry, @@ -394,7 +396,7 @@ def create_metrics_of_physical_drive( physical_drive, detailed_info_array, controller_index ): enclosure, slot = physical_drive.get("EID:Slt").split(":")[:2] - + type_pd = physical_drive.get("Type") if enclosure == " ": drive_identifier = "Drive /c{0}/s{1}".format(controller_index, slot) enclosure = "" @@ -457,6 +459,8 @@ def create_metrics_of_physical_drive( physical_drive["State"], attributes["Firmware Revision"].strip(), attributes["SN"].strip(), + attributes["Manufacturer Id"].strip(), + type_pd, ).set(1) if "Drive Temperature" in state and state["Drive Temperature"] != "N/A":