Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Fixed Issue #29 for not existing volume grups
Browse files Browse the repository at this point in the history
  • Loading branch information
genegr committed Apr 16, 2021
1 parent f3e7238 commit ca99a84
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions flasharray_collector/flasharray_metrics/host_volume_metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from prometheus_client.core import GaugeMetricFamily


class HostVolumeMetrics():
"""
Base class for mapping FlashArray hosts to connected volumes
"""

def __init__(self, fa):
self.fa = fa
self.map_host_vol = GaugeMetricFamily('purefa_host_volumes_info',
'FlashArray host volumes connections',
labels=['host', 'naaid'])

def _map_host_vol(self):
for hv in self.fa.get_host_volumes():
self.map_host_vol.add_metric([hv['host'], hv['naaid']], 1)



def get_metrics(self):
self._map_host_vol()
yield self.map_host_vol

0 comments on commit ca99a84

Please sign in to comment.