Created
May 30, 2019 10:59
-
-
Save maleadt/da94d817368540018e5b433e31a4effa to your computer and use it in GitHub Desktop.
Munin plugin for FritzBox DSL properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/fritzconnection/bin/python2 | |
import sys | |
from fritzconnection import FritzConnection | |
if len(sys.argv)>1: | |
if sys.argv[1]=="config": | |
print ''' | |
host_name TODO | |
multigraph dsl_throughput | |
graph_order max_down max_up cur_down cur_up | |
graph_title DSL throughput | |
graph_args --base 1000 | |
graph_vlabel bits down (-) / up (+) | |
graph_category dsl | |
max_down.graph no | |
max_down.cdef max_down,1000,* | |
max_up.label attainable | |
max_up.negative max_down | |
max_up.cdef max_up,1000,* | |
max_up.info Attainable throughput. | |
cur_down.graph no | |
cur_down.cdef cur_down,1000,* | |
cur_up.label current | |
cur_up.negative cur_down | |
cur_up.cdef cur_up,1000,* | |
cur_up.info Current throughput. | |
multigraph dsl_quality | |
graph_order noise_down noise_up att_down att_up | |
graph_title DSL quality | |
graph_args --base 1000 | |
graph_vlabel dB down (-) / up (+) | |
graph_category dsl | |
noise_down.graph no | |
noise_down.cdef noise_down,10,/ | |
noise_up.label noise margin | |
noise_up.negative noise_down | |
noise_up.cdef noise_up,10,/ | |
noise_up.info Signal-to-noise ratio. | |
att_down.graph no | |
att_down.cdef att_down,10,/ | |
att_up.label attenuation | |
att_up.negative att_down | |
att_up.cdef att_up,10,/ | |
att_up.info Line attenuation. | |
''' | |
sys.exit(0) | |
else: | |
sys.exit(1) | |
connection = FritzConnection(address="192.168.178.1", password=TODO) | |
info = connection.call_action('WANDSLInterfaceConfig', 'GetInfo') | |
print ''' | |
multigraph dsl_throughput | |
max_down.value {NewDownstreamMaxRate} | |
max_up.value {NewUpstreamMaxRate} | |
cur_down.value {NewDownstreamCurrRate} | |
cur_up.value {NewUpstreamCurrRate} | |
multigraph dsl_quality | |
noise_down.value {NewDownstreamNoiseMargin} | |
noise_up.value {NewUpstreamNoiseMargin} | |
att_down.value {NewDownstreamAttenuation} | |
att_up.value {NewUpstreamAttenuation} | |
'''.format(**info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment