Skip to content

Commit

Permalink
use short hostname for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
paulczar committed Mar 6, 2015
1 parent 7937056 commit 35f7ba1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sensu/plugins/metrics-nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def main():
hypervisors = client.hypervisors.list()

for hv in hypervisors:
hostname = hv.hypervisor_hostname.split('.')[0]
for key, value in hv.to_dict().iteritems():
if key in METRIC_KEYS:
output_metric('{}.{}.{}'.format(args.scheme, hv.hypervisor_hostname, key), value)
output_metric('{}.{}.{}'.format(args.scheme, hostname, key), value)

if __name__ == '__main__':
main()

0 comments on commit 35f7ba1

Please sign in to comment.