From 2bb567c24efe20ac29d0bb33f007c139155c5c68 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 5 Jun 2018 11:05:00 +1000 Subject: [PATCH] Allow default statsd values Show the defaults in the debug log if nothing is specified --- afsmon/cmd/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/afsmon/cmd/main.py b/afsmon/cmd/main.py index d88987c..1319a1f 100644 --- a/afsmon/cmd/main.py +++ b/afsmon/cmd/main.py @@ -49,8 +49,10 @@ class AFSMonCmd(object): statsd_args['host'] = os.environ['STATSD_HOST'] if os.getenv('STATSD_PORT', None): statsd_args['port'] = os.environ['STATSD_PORT'] - logger.debug("Sending stats to %s:%s" % (statsd_args['host'], - statsd_args['port'])) + logger.debug("Sending stats to %s:%s" % ( + statsd_args.get('host', 'localhost'), + statsd_args.get('port', '8125')) + ) self.statsd = statsd.StatsClient(**statsd_args) # With a lot of volumes, we can flood out a lot of stats