diff options
author | Christopher Baines <mail@cbaines.net> | 2016-03-05 19:15:21 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2016-03-05 19:15:21 +0000 |
commit | c42b0529ddebcd95ea3734d1d12014c104808934 (patch) | |
tree | dbfa9b0f3f4828f6ac572ee3bfb951b15e9156ed /prometheus_haproxy_log_exporter | |
parent | b7e3267134a7602c261fc2e5a30e2cb34bb5bd0f (diff) | |
download | prometheus-haproxy-log-exporter-c42b0529ddebcd95ea3734d1d12014c104808934.tar prometheus-haproxy-log-exporter-c42b0529ddebcd95ea3734d1d12014c104808934.tar.gz |
Support changing the port and host to export metrics on
Diffstat (limited to 'prometheus_haproxy_log_exporter')
-rw-r--r-- | prometheus_haproxy_log_exporter/cli.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/prometheus_haproxy_log_exporter/cli.py b/prometheus_haproxy_log_exporter/cli.py index 24e085d..db6357f 100644 --- a/prometheus_haproxy_log_exporter/cli.py +++ b/prometheus_haproxy_log_exporter/cli.py @@ -50,6 +50,20 @@ def get_argument_parser(): ) p.add( + '--port', + default='9129', + help="Port on which to expose metrics", + type=int, + env_var='PORT', + ) + p.add( + '--host', + default='0.0.0.0', + help="Host on which to expose metrics", + env_var='HOST', + ) + + p.add( '--licence-location', default=join(dirname(dirname(normpath(__file__))), 'LICENSE'), help="The location of the licence, linked to through the web interface", @@ -243,8 +257,8 @@ def main(): log_processor = create_log_processor(options, p.error) log_processor.start() - host = '0.0.0.0' - port = 9129 + host = options.host + port = options.port httpd = HTTPServer( (host, port), |