From 35f7ba1e651fb9e86e208a1e4d9e3b5e05da0c84 Mon Sep 17 00:00:00 2001 From: Paul Czarkowski Date: Fri, 6 Mar 2015 13:57:19 -0600 Subject: [PATCH] use short hostname for metrics --- sensu/plugins/metrics-nova.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sensu/plugins/metrics-nova.py b/sensu/plugins/metrics-nova.py index 128d7df..280f023 100755 --- a/sensu/plugins/metrics-nova.py +++ b/sensu/plugins/metrics-nova.py @@ -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()