@@ -1937,6 +1937,8 @@ def main(argv=None):
1937
1937
parser = argparse .ArgumentParser (description = 'VMWare metrics exporter for Prometheus' )
1938
1938
parser .add_argument ('-c' , '--config' , dest = 'config_file' ,
1939
1939
default = None , help = "configuration file" )
1940
+ parser .add_argument ('-a' , '--address' , dest = 'address' , type = str ,
1941
+ default = '' , help = "HTTP address to expose metrics" )
1940
1942
parser .add_argument ('-p' , '--port' , dest = 'port' , type = int ,
1941
1943
default = 9272 , help = "HTTP port to expose metrics" )
1942
1944
parser .add_argument ('-l' , '--loglevel' , dest = 'loglevel' ,
@@ -1952,8 +1954,8 @@ def main(argv=None):
1952
1954
reactor .suggestThreadPoolSize (25 )
1953
1955
1954
1956
factory = Site (registerEndpoints (args ))
1955
- logging .info ("Starting web server on port {port}" .format (port = args .port ))
1956
- endpoint = endpoints .TCP4ServerEndpoint (reactor , args .port )
1957
+ logging .info ("Starting web server on port {address}:{ port}" .format (address = args . address , port = args .port ))
1958
+ endpoint = endpoints .TCP4ServerEndpoint (reactor , args .port , interface = args . address )
1957
1959
endpoint .listen (factory )
1958
1960
reactor .run ()
1959
1961
0 commit comments