From 897de1bbbac8bee0bb098c9b0f73185ad09e2d93 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Mon, 31 Aug 2020 12:55:40 +1000 Subject: [PATCH] squash! [plugins/transmission] Fixups for consistency Only show host in title when not localhost --- plugins/network/transmission | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/network/transmission b/plugins/network/transmission index e87613ef..d07a8e18 100755 --- a/plugins/network/transmission +++ b/plugins/network/transmission @@ -84,11 +84,12 @@ host = os.getenv('host','localhost') port = os.getenv('port',9091) user = os.getenv('user') passwd = os.getenv('pass') +title_host = '' if host in ['localhost', '127.0.0.1', '::1'] else ' on ' + host def config(): conf = Template("""multigraph ${plugin_name}_throughput -graph_title Transmission throughput +graph_title Transmission throughput${title_host} graph_vlabel bytes/${graph_period} in (-) / out (+) graph_args --base 1000 graph_category network @@ -105,7 +106,7 @@ up.draw AREA up.min 0 multigraph ${plugin_name}_activity -graph_title Transmission activity +graph_title Transmission activity${title_host} graph_vlabel torrents graph_args --base 1000 graph_category network @@ -119,7 +120,7 @@ paused.draw STACK paused.min 0 paused.colour COLOUR8 """) - print conf.safe_substitute(plugin_name=plugin_name, host=host) + print conf.safe_substitute(plugin_name=plugin_name, host=host, title_host=title_host) sys.exit(0)