Skip to content

Commit

Permalink
rename the labels to server_*
Browse files Browse the repository at this point in the history
add the disk_protocol label to easier identify NVMe disks
  • Loading branch information
BerndKue committed Dec 10, 2021
1 parent 09e2edc commit 95db3b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]

Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit 95db3b2

Please sign in to comment.