Merge pull request #18 from bobvandevijver/remove-traffic-max

Fixes #13. Configurable traffic maximum
This commit is contained in:
Christian Stade-Schuldt 2017-09-06 22:28:41 +02:00 committed by GitHub
commit 209eed91ae
2 changed files with 20 additions and 14 deletions

View File

@ -27,6 +27,10 @@ If you are using the scripts on a different Fritz!Box model please let me know b
fritzbox\_traffic shows you the traffic of the WAN interface (requires fritzconnection)
![http://i.imgur.com/8BwNMOL.png](http://i.imgur.com/8BwNMOL.png)
If you do not want to show the interface maximum values, add the following to your plugin-configuration:
env.traffic_remove_max true
## fritzbox\_connection\_uptime
fritzbox\_connection\_uptime shows you the connection uptime in days (requires fritzconnection)

View File

@ -32,6 +32,7 @@ def print_values():
up_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetTotalBytesSent')['NewTotalBytesSent']
print ('up.value %d' % up_traffic)
if not os.environ.get('traffic_remove_max'):
max_down_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
'NewLayer1DownstreamMaxBitRate']
print ('maxdown.value %d' % max_down_traffic)
@ -61,6 +62,7 @@ def print_config():
print "up.max 1000000000"
print "up.negative down"
print "up.info Traffic of the WAN interface."
if not os.environ.get('traffic_remove_max'):
print "maxdown.label received"
print "maxdown.type GAUGE"
print "maxdown.graph no"