Schmidsfeld / TelegrafFritzBox

Telegraf collector help file for the FritzBox by AVM
MIT License
51 stars 12 forks source link

What do certain values mean? #1

Closed smaxx1337 closed 4 years ago

smaxx1337 commented 4 years ago

Hello,

I saw your reddit post yesterday and then wanted to collect data about my Fritz!Box and internet as well. I got it running for my Fritz!Box 6490 Cable after some modifications, like removing DSL stuff and stuff that simply didn't work for me:

#connectionInfo = readfritz('WANPPPConnection1', 'GetInfo') 
#dslInfo = readfritz('WANDSLInterfaceConfig1', 'GetInfo')
#dslError = readfritz('WANDSLInterfaceConfig1', 'GetStatisticsTotal')
#dslInfo = readfritz('WANDSLInterfaceConfig1', 'GetInfo')
#externalIP = extractvar(connectionInfo, 'NewExternalIPAddress', False)
#dns = extractvar(connectionInfo, 'NewDNSServers', False)
#dslDown = extractvar(dslInfo, 'NewDownstreamCurrRate', True)
#dslUp = extractvar(dslInfo, 'NewUpstreamCurrRate', True)
#dslMaxDown = extractvar(dslInfo, 'NewDownstreamMaxRate', True)
#dslMaxUp = extractvar(dslInfo, 'NewUpstreamMaxRate', True)
#noiseDown = extractvar(dslInfo, 'NewDownstreamNoiseMargin', True)
#noiseUp = extractvar(dslInfo, 'NewUpstreamNoiseMargin', True)
#powerDown = extractvar(dslInfo, 'NewDownstreamPower', True)
#powerUp = extractvar(dslInfo, 'NewUpstreamPower', True)
#attenuationDown = extractvar(dslInfo, 'NewDownstreamAttenuation', True)
#attenuationUp = extractvar(dslInfo, 'NewUpstreamAttenuation', True)
#fecError = extractvar(dslError, 'NewFECErrors', True)
#fecErrorLocal = extractvar(dslError, 'NewATUCFECErrors', True)
#crcError = extractvar(dslError, 'NewCRCErrors', True)
#crcErrorLocal = extractvar(dslError, 'NewATUCCRCErrors', True)
#hecError = extractvar(dslError, 'NewHECErrors', True)
#hecErrorLocal = extractvar(dslError, 'NewATUCHECErrors', True)

#influxrow('dsl', dsl)
#network = assemblevar(externalIP, dns, localDns, hostsKnown)
#influxrow('network', network)

I also modified some dashboard stuff for my personal taste, like making uptime to days instead of seconds, or instead of TotalBytesReceived to Megabytes received.

So, if anyone here wants to do this but uses DOCSIS / Cable, then he should comment these lines out. Maybe you could put a section into the README.md regarding this.

smaxx1337 commented 4 years ago

I just see that I have the wrong title, lol. Title should be "Making it run n Fritz!Box 6490 Cable"

chevdor commented 4 years ago

See #4 as well as https://github.com/chevdor/TelegrafFritzBox/tree/6490

This is a version running on a 6490 (skipping the faulty metrics until we figure out the issue). I also just published a '6490' of the docker image https://hub.docker.com/repository/docker/chevdor/fritzgraf that would may find convenient :)

See as well #3

Schmidsfeld commented 4 years ago

Sorry it took me so long to fix this issue.

The root cause is that the metrics for HEC/CRC/FEC errors and other line specific stuff dosn't exist for my knowledge in the TR-064 for the Fritz!Box 6490 Cable. In fact the whole file of WANDSLInterfaceConfig1 seems to be missing. If I had to guess something like WANDOCSISInterfaceConfig1 could exist containing similar variables. Please point me to the crrect naming there to be included.

For now I simply put a switch statemet in the file and did some exception handling, to hopefully make the cript run better with missing variables. Namely the readfritz and extractvar procedures should be a bit more robust.