diff --git a/fritzbox_connection_uptime.py b/fritzbox_connection_uptime.py index d9f6362..2f01474 100755 --- a/fritzbox_connection_uptime.py +++ b/fritzbox_connection_uptime.py @@ -19,6 +19,9 @@ import sys from fritzconnection import FritzConnection +# bet box name from first part before '_' in (symlink) file name +boxname = os.path.basename(__file__).rsplit('_')[0] + def print_values(): try: @@ -31,7 +34,7 @@ def print_values(): def print_config(): - print "host_name fritzbox" + print "host_name %s" % boxname print "graph_title AVM Fritz!Box Connection Uptime" print "graph_args --base 1000 -l 0" print 'graph_vlabel uptime in days' diff --git a/fritzbox_cpu_temperature.py b/fritzbox_cpu_temperature.py index 159cc73..1dad21a 100755 --- a/fritzbox_cpu_temperature.py +++ b/fritzbox_cpu_temperature.py @@ -25,6 +25,9 @@ import fritzbox_helper as fh PAGE = '/system/ecostat.lua' pattern = re.compile('Query\s=\s"(\d{1,3})') +# bet box name from first part before '_' in (symlink) file name +boxname = os.path.basename(__file__).rsplit('_')[0] + def get_cpu_temperature(): """get the current cpu temperature""" @@ -42,7 +45,7 @@ def get_cpu_temperature(): def print_config(): - print "host_name fritzbox" + print "host_name %s" % boxname print "graph_title AVM Fritz!Box CPU temperature" print "graph_vlabel degrees Celsius" print "graph_category sensors" diff --git a/fritzbox_cpu_usage.py b/fritzbox_cpu_usage.py index ef9469a..bbaef23 100755 --- a/fritzbox_cpu_usage.py +++ b/fritzbox_cpu_usage.py @@ -25,6 +25,9 @@ import fritzbox_helper as fh PAGE = '/system/ecostat.lua' pattern = re.compile('Query1\s=\s"(\d{1,3})') +# bet box name from first part before '_' in (symlink) file name +boxname = os.path.basename(__file__).rsplit('_')[0] + def get_cpu_usage(): """get the current cpu usage""" @@ -42,7 +45,7 @@ def get_cpu_usage(): def print_config(): - print "host_name fritzbox" + print "host_name %s" % boxname print "graph_title AVM Fritz!Box CPU usage" print "graph_vlabel %" print "graph_category system" diff --git a/fritzbox_memory_usage.py b/fritzbox_memory_usage.py index 12ae9aa..b4f1f47 100755 --- a/fritzbox_memory_usage.py +++ b/fritzbox_memory_usage.py @@ -26,6 +26,9 @@ PAGE = '/system/ecostat.lua' pattern = re.compile('Query[1-3]\s="(\d{1,3})') USAGE = ['free', 'cache', 'strict'] +# bet box name from first part before '_' in (symlink) file name +boxname = os.path.basename(__file__).rsplit('_')[0] + def get_memory_usage(): """get the current memory usage""" @@ -44,7 +47,7 @@ def get_memory_usage(): def print_config(): - print "host_name fritzbox" + print "host_name %s" % boxname print "graph_title AVM Fritz!Box Memory" print "graph_vlabel %" print "graph_args --base 1000 -r --lower-limit 0 --upper-limit 100" diff --git a/fritzbox_power_consumption.py b/fritzbox_power_consumption.py index 3a5cbc0..20f063f 100755 --- a/fritzbox_power_consumption.py +++ b/fritzbox_power_consumption.py @@ -26,6 +26,9 @@ PAGE = '/system/energy.lua' pattern = re.compile('