1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

squash! [plugins/transmission] Fixups for consistency

Only show host in title when not localhost
This commit is contained in:
Olivier Mehani 2020-08-31 12:55:40 +10:00
parent e254623ba1
commit 897de1bbba

View file

@ -84,11 +84,12 @@ host = os.getenv('host','localhost')
port = os.getenv('port',9091) port = os.getenv('port',9091)
user = os.getenv('user') user = os.getenv('user')
passwd = os.getenv('pass') passwd = os.getenv('pass')
title_host = '' if host in ['localhost', '127.0.0.1', '::1'] else ' on ' + host
def config(): def config():
conf = Template("""multigraph ${plugin_name}_throughput conf = Template("""multigraph ${plugin_name}_throughput
graph_title Transmission throughput graph_title Transmission throughput${title_host}
graph_vlabel bytes/${graph_period} in (-) / out (+) graph_vlabel bytes/${graph_period} in (-) / out (+)
graph_args --base 1000 graph_args --base 1000
graph_category network graph_category network
@ -105,7 +106,7 @@ up.draw AREA
up.min 0 up.min 0
multigraph ${plugin_name}_activity multigraph ${plugin_name}_activity
graph_title Transmission activity graph_title Transmission activity${title_host}
graph_vlabel torrents graph_vlabel torrents
graph_args --base 1000 graph_args --base 1000
graph_category network graph_category network
@ -119,7 +120,7 @@ paused.draw STACK
paused.min 0 paused.min 0
paused.colour COLOUR8 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) sys.exit(0)