Skip to content

Commit

Permalink
Update vmware_exporter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Teriand authored Mar 1, 2018
1 parent 5b63746 commit a4531bd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ def collect(self, target=None, section='default'):
self._vmware_get_vms(content, metrics, counter_info)

# Fill Snapshots (count and age)
vm_counts, vm_ages = self._vmware_get_snapshots(content)
for v in vm_counts:
metrics['vmware_vm_snapshots'].add_metric([v['vm_name']],
v['snapshot_count'])
for vm_age in vm_ages:
for v in vm_age:
metrics['vmware_vm_snapshot_timestamp_seconds'].add_metric([v['vm_name'],
v['vm_snapshot_name']],
v['vm_snapshot_timestamp_seconds'])
vm_counts, vm_ages = self._vmware_get_snapshots(content)
for v in vm_counts:
metrics['vmware_vm_snapshots'].add_metric([v['vm_name']],
v['snapshot_count'])
for vm_age in vm_ages:
for v in vm_age:
metrics['vmware_vm_snapshot_timestamp_seconds'].add_metric([v['vm_name'],
v['vm_snapshot_name']],
v['vm_snapshot_timestamp_seconds'])


# Fill Datastore
Expand All @@ -225,7 +225,7 @@ def collect(self, target=None, section='default'):
for metricname, metric in metrics.items():
yield metric

def _collect_subsystems(self, section, valid_subsystems):
def _collect_subsystems(self, section, valid_subsystems):
"""
Return the list of subsystems to collect - everything by default, a
subset if the config section has collect_only specified
Expand Down

0 comments on commit a4531bd

Please sign in to comment.