From 6cf8f2d5174a53f582e61d715edbb88d6e3367cc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 14 Jun 2023 21:20:33 +0200 Subject: Adding upstream version 1.40.0. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/tor/tor.chart.py | 4 +++- collectors/python.d.plugin/tor/tor.conf | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'collectors/python.d.plugin/tor') diff --git a/collectors/python.d.plugin/tor/tor.chart.py b/collectors/python.d.plugin/tor/tor.chart.py index 8dc021a63..f7bc2d79b 100644 --- a/collectors/python.d.plugin/tor/tor.chart.py +++ b/collectors/python.d.plugin/tor/tor.chart.py @@ -17,6 +17,7 @@ except ImportError: STEM_AVAILABLE = False DEF_PORT = 'default' +DEF_ADDR = '127.0.0.1' ORDER = [ 'traffic', @@ -41,6 +42,7 @@ class Service(SimpleService): self.order = ORDER self.definitions = CHARTS self.port = self.configuration.get('control_port', DEF_PORT) + self.addr = self.configuration.get('control_addr', DEF_ADDR) self.password = self.configuration.get('password') self.use_socket = isinstance(self.port, str) and self.port != DEF_PORT and not self.port.isdigit() self.conn = None @@ -78,7 +80,7 @@ class Service(SimpleService): def connect_via_port(self): try: - self.conn = stem.control.Controller.from_port(port=self.port) + self.conn = stem.control.Controller.from_port(address=self.addr, port=self.port) except (stem.SocketError, ValueError) as error: self.error(error) diff --git a/collectors/python.d.plugin/tor/tor.conf b/collectors/python.d.plugin/tor/tor.conf index bf09b21fe..c7c98dc0b 100644 --- a/collectors/python.d.plugin/tor/tor.conf +++ b/collectors/python.d.plugin/tor/tor.conf @@ -61,6 +61,7 @@ # # Additionally to the above, tor plugin also supports the following: # +# control_addr: 'address' # tor control IP address (defaults to '127.0.0.1') # control_port: 'port' # tor control port # password: 'password' # tor control password # @@ -71,6 +72,7 @@ # local_tcp: # name: 'local' # control_port: 9051 +# control_addr: 127.0.0.1 # password: # # local_socket: -- cgit v1.2.3