diff --git a/fritzbox__connection_uptime.py b/fritzbox__connection_uptime.py index 9721fa6..b71106c 100755 --- a/fritzbox__connection_uptime.py +++ b/fritzbox__connection_uptime.py @@ -28,7 +28,7 @@ from fritzconnection.lib.fritzstatus import FritzStatus def print_values(): try: conn = FritzStatus(address=os.environ['fritzbox_ip'], password=os.environ['fritzbox_password']) - except Exception as e: + except Exception: sys.exit("Couldn't get connection uptime") uptime = conn.uptime @@ -36,6 +36,8 @@ def print_values(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) print("graph_title AVM Fritz!Box Connection Uptime") print("graph_args --base 1000 -l 0") print('graph_vlabel uptime in hours') diff --git a/fritzbox__cpu_temperature.py b/fritzbox__cpu_temperature.py index d38015a..02670c1 100755 --- a/fritzbox__cpu_temperature.py +++ b/fritzbox__cpu_temperature.py @@ -36,6 +36,8 @@ def get_cpu_temperature(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) 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 4f56321..5ac8a0d 100755 --- a/fritzbox__cpu_usage.py +++ b/fritzbox__cpu_usage.py @@ -20,7 +20,7 @@ import os import sys import fritzbox_helper as fh -PAGE = 'ecoStat' +PAGE = { '7': 'ecoStat', '6': 'system/ecostat.lua' } def get_cpu_usage(): @@ -36,6 +36,8 @@ def get_cpu_usage(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) 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 a73d13b..d91bc3f 100755 --- a/fritzbox__memory_usage.py +++ b/fritzbox__memory_usage.py @@ -38,6 +38,8 @@ def get_memory_usage(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) 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 9d71a76..f7c290f 100755 --- a/fritzbox__power_consumption.py +++ b/fritzbox__power_consumption.py @@ -41,6 +41,8 @@ def get_power_consumption(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) print("graph_title AVM Fritz!Box Power Consumption") print("graph_vlabel %") print("graph_category system") diff --git a/fritzbox__traffic.py b/fritzbox__traffic.py index a8122fd..810196b 100755 --- a/fritzbox__traffic.py +++ b/fritzbox__traffic.py @@ -52,6 +52,8 @@ def print_config(): max_traffic = conn.max_bit_rate + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) print("graph_title AVM Fritz!Box WAN traffic") print("graph_args --base 1000") print("graph_vlabel bit up (-) / down (+) per ${graph_period}") diff --git a/fritzbox__uptime.py b/fritzbox__uptime.py index 649c0d0..1a71c5d 100755 --- a/fritzbox__uptime.py +++ b/fritzbox__uptime.py @@ -59,6 +59,8 @@ def get_uptime(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) print("graph_title AVM Fritz!Box Uptime") print("graph_args --base 1000 -l 0") print('graph_vlabel uptime in days') diff --git a/fritzbox__wifi_devices.py b/fritzbox__wifi_devices.py index 180eb73..c47cd96 100755 --- a/fritzbox__wifi_devices.py +++ b/fritzbox__wifi_devices.py @@ -40,6 +40,8 @@ def get_connected_wifi_devices(): def print_config(): + hostname = os.path.basename(__file__).split('_')[1] + print("host_name %s" % hostname) print('graph_title AVM Fritz!Box Connected Wifi Devices') print('graph_vlabel Number of devices') print('graph_args --base 1000')