From 95db3b2d6fb0278a82f3bef2e5dbc896bb439586 Mon Sep 17 00:00:00 2001 From: d032408 Date: Fri, 10 Dec 2021 16:13:53 +0100 Subject: [PATCH] rename the labels to server_* add the disk_protocol label to easier identify NVMe disks --- collector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector.py b/collector.py index 015d408..13e4295 100644 --- a/collector.py +++ b/collector.py @@ -210,7 +210,7 @@ def _get_labels(self): serial = server_info['SKU'] else: serial = server_info['SerialNumber'] - self._labels.update({'host': self._host, 'manufacturer': self._manufacturer, 'model': self._model, 'serial': serial}) + self._labels.update({'host': self._host, 'server_manufacturer': self._manufacturer, 'server_model': self._model, 'server_serial': serial}) self._server_health = self._status[server_info['Status']['Health'].lower()] @@ -288,7 +288,7 @@ def get_storage_health(self): self._health_metrics.add_sample('redfish_health', value=controller_status, labels=current_labels) # Sometimes not all attributes are implemented. Checking if existing one by one. - disk_attributes = {'Name': 'name', 'MediaType': 'disk_type', 'Model': 'disk_model', 'Manufacturer': 'disk_manufacturer', 'CapacityBytes': 'disk_capacity'} + disk_attributes = {'Name': 'name', 'MediaType': 'disk_type', 'Model': 'disk_model', 'Manufacturer': 'disk_manufacturer', 'CapacityBytes': 'disk_capacity', 'Protocol': 'disk_protocol'} for disk in controller_data['Drives']: current_labels = {'type': 'disk'} disk_data = self.connect_server(disk['@odata.id'])