Remove 'AVM Fritz!Box' from titles when env.host_name is specified

This allows the graph to be better grouped with other hosts.

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
(cherry picked from commit 09b56fde9421a78c78d6ecc4e76320208910de08)
This commit is contained in:
Olivier Mehani 2019-09-30 14:24:34 +10:00
parent 030c3bda5f
commit fabad1fdd5
8 changed files with 41 additions and 25 deletions

View File

@ -31,6 +31,10 @@ def print_values():
def print_config():
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Connection Uptime")
else:
print("graph_title AVM Fritz!Box Connection Uptime")
print("graph_args --base 1000 -l 0")
print('graph_vlabel uptime in days')
@ -38,8 +42,6 @@ def print_config():
print("graph_category network")
print("uptime.label uptime")
print("uptime.draw AREA")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == "__main__":

View File

@ -41,7 +41,11 @@ def get_cpu_temperature():
def print_config():
print("graph_title AVM Fritz!Box CPU temperature")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Temperatures")
else:
print("graph_title AVM Fritz!Box CPU temperature")
print("graph_vlabel degrees Celsius")
print("graph_category sensors")
print("graph_order tmp")
@ -51,8 +55,6 @@ def print_config():
print("temp.graph LINE1")
print("temp.min 0")
print("temp.info Fritzbox CPU temperature")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':

View File

@ -41,7 +41,11 @@ def get_cpu_usage():
def print_config():
print("graph_title AVM Fritz!Box CPU usage")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title CPU usage")
else :
print("graph_title AVM Fritz!Box CPU usage")
print("graph_vlabel %")
print("graph_category system")
print("graph_order cpu")
@ -51,8 +55,6 @@ def print_config():
print("cpu.graph AREA")
print("cpu.min 0")
print("cpu.info Fritzbox CPU usage")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':

View File

@ -43,7 +43,11 @@ def get_memory_usage():
def print_config():
print("graph_title AVM Fritz!Box Memory")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Memory usage in percent")
else:
print("graph_title AVM Fritz!Box Memory")
print("graph_vlabel %")
print("graph_args --base 1000 -r --lower-limit 0 --upper-limit 100")
print("graph_category system")
@ -59,8 +63,6 @@ def print_config():
print("free.label free")
print("free.type GAUGE")
print("free.draw STACK")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':

View File

@ -46,9 +46,13 @@ def get_power_consumption():
def print_config():
print("graph_title AVM Fritz!Box Power Consumption")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Power consumption")
else:
print("graph_title AVM Fritz!Box Power Consumption")
print("graph_vlabel %")
print("graph_category system")
print("graph_category sensors")
print("graph_order system cpu wifi dsl ab usb")
print("system.label system")
print("system.type GAUGE")
@ -86,8 +90,6 @@ def print_config():
print("usb.min 0")
print("usb.max 100")
print("usb.info Fritzbox usb devices power consumption")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':

View File

@ -43,7 +43,11 @@ def print_values():
def print_config():
print("graph_title AVM Fritz!Box WAN traffic")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Uplink traffic")
else:
print("graph_title AVM Fritz!Box WAN traffic")
print("graph_args --base 1000")
print("graph_vlabel bits in (-) / out (+) per \${graph_period}")
print("graph_category network")
@ -71,8 +75,6 @@ def print_config():
print("maxup.negative maxdown")
print("maxup.draw LINE1")
print("maxup.info Maximum speed of the WAN interface.")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == "__main__":

View File

@ -64,15 +64,17 @@ def get_uptime():
def print_config():
print("graph_title AVM Fritz!Box Uptime")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print("graph_title Uptime")
else:
print("graph_title AVM Fritz!Box Uptime")
print("graph_args --base 1000 -l 0")
print('graph_vlabel uptime in days')
print("graph_scale no'")
print("graph_category system")
print("uptime.label uptime")
print("uptime.draw AREA")
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':

View File

@ -32,7 +32,7 @@ pattern = re.compile(patternLoc[locale])
def get_connected_wifi_devices():
"""gets the numbrer of currently connected wifi devices"""
"""gets the numbrer of currently connected wi-fi devices"""
server = os.getenv('fritzbox_ip')
password = os.getenv('FRITZ_PASSWORD')
@ -51,7 +51,11 @@ def get_connected_wifi_devices():
def print_config():
print('graph_title AVM Fritz!Box Connected Wifi Devices')
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
print('graph_title Connected Wi-Fi Devices')
else:
print('graph_title AVM Fritz!Box Connected Wi-Fi Devices')
print('graph_vlabel Number of devices')
print('graph_args --base 1000')
print('graph_category network')
@ -60,8 +64,6 @@ def print_config():
print('wifi.type GAUGE')
print('wifi.graph LINE1')
print('wifi.info Wifi Connections on 2.4 & 5 Ghz')
if os.environ.get('host_name'):
print("host_name " + os.getenv('host_name'))
if __name__ == '__main__':