Schmidsfeld/TelegrafFritzBox

Script failing on a 6490

Closed this issue · 1 comments

I am mainly opening this issue to track down what values are causing troubles:
Here is the diff of what I had to comment out for a 6490:
chevdor@cc6fe96

This issue is probably similar/related to #2

@chevdor : Can you please post the output of:
I Think we will be able to get a good functionality going soon :D

´´´
#!/opt/bin/python3

from fritzconnection import FritzConnection
import sys
import os

FRITZBOX_IP = os.environ.get('FRITZ_IP', '192.168.178.1')
FRITZBOX_USER = os.environ.get('FRITZ_USER', 'telegraf')
FRITZBOX_PASSWORD = os.environ.get('Fritz_PASSWD' "SuperStrongPassword")
FRITZBOX_ID = os.environ.get('FRITZ_ID', 'FritzBox')

try:
fc = FritzConnection(address=FRITZBOX_IP, user=FRITZBOX_USER, password=FRITZBOX_PASSWORD, timeout=2.0)
except BaseException:
print("Cannot connect to fritzbox.")
sys.exit(1)

def readfritz(module, action):
try:
answer = fc.call_action(module, action)
except:
answer = dict() #return an emty dict in case of failure
return answer

connectionInfo = readfritz('WANPPPConnection1', 'GetInfo')

connectionStatus = readfritz('WANPPPConnection1', 'GetStatusInfo')

connectionRates = readfritz('WANPPPConnection1', 'GetLinkLayerMaxBitRates')

print(connectionInfo)
print(connectionStatus)
print(connectionRates)

´´´´