From e5d2d118b70d4b212e6db1994bee397afa16f5d4 Mon Sep 17 00:00:00 2001 From: znerol Date: Tue, 24 Dec 2024 12:16:06 +0100 Subject: [PATCH] Add pve_up metric for storage --- src/pve_exporter/collector/cluster.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pve_exporter/collector/cluster.py b/src/pve_exporter/collector/cluster.py index 737c9b9..d327ce5 100644 --- a/src/pve_exporter/collector/cluster.py +++ b/src/pve_exporter/collector/cluster.py @@ -43,6 +43,10 @@ def collect(self): # pylint: disable=missing-docstring label_values = [resource['id']] status_metrics.add_metric(label_values, resource['status'] == 'running') + for resource in self._pve.cluster.resources.get(type='storage'): + label_values = [resource['id']] + status_metrics.add_metric(label_values, resource['status'] == 'available') + yield status_metrics