test multi box support

This commit is contained in:
oe73773 2020-07-11 16:56:32 +02:00
parent e34cd24e33
commit 2f1c80fcb5
8 changed files with 18 additions and 2 deletions

View File

@ -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')

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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}")

View File

@ -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')

View File

@ -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')