Schmidsfeld / TelegrafFritzBox

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

telegraf metric parse error #8

Open richi3161 opened 3 years ago

richi3161 commented 3 years ago

Jan 15 10:32:27 monitor telegraf[21835]: 2021-01-15T09:32:27Z E! [inputs.exec] Error in plugin: metric parse error: expected tag at 1:10: "FritzBox,,source=general ,WANAccessType=\"Cable\",Fi

stillbeben commented 3 years ago

This issue occurs after updating to FritzOS 7.25. Updating to fritzconnection 1.4.2 (latest) doesn't resolve. I couldn't find an open issue for FritzOS 7.25 compatibility. Not sure if I'll find the time to investigate further in the next days. Maybe someone else will.

FerFemNemBem commented 3 years ago

Hi,

please have a look at: https://github.com/Schmidsfeld/TelegrafFritzBox/issues/9

Cheers FFNB

Am 14.03.2021 um 09:56 schrieb Rico Ullmann:

This issue occurs after updating to FritzOS 7.25. Updating to fritzconnection 1.4.2 (latest) doesn't resolve. I couldn't find an open issue for FritzOS 7.25 compatibility. Not sure if I'll find the time to investigate further in the next days. Maybe someone else will.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Schmidsfeld/TelegrafFritzBox/issues/8#issuecomment-798871739, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARXOQF7SYSFR4B6TZ72OOCDTDR237ANCNFSM4WDZCUTA.

acocalypso commented 3 years ago

Hi,

I wanted to test it on my FritzBox Cable 6591 and the python script itself executs perfectly fine.

Telegraf anyhow has some metric parse issues

[inputs.exec] Error in plugin: metric parse error: expected field at 3:33: "FritzBox,host=(none),source=wan

I'm on version 7.21

/home/pi/fritzbox_env/bin/python3 telegrafFritzBox.py -i 192.168.178.1 -p mysupersecretpassword
FritzBox,host=(none),source=general ModelName="FRITZ!Box 6591 Cable (kdg)",WANAccessType="Cable",SerialNumber="2C91AB74D85A",Firmware="7.21"
FritzBox,host=(none),source=status UpTime=1329942i
FritzBox,host=(none),source=wan ,Layer1DownstreamMaxBitRate=57500000i,Layer1UpstreamMaxBitRate=5750000i,ByteReceiveRate=470953i,ByteSendRate=156476i,PacketReceiveRate=0i,PacketSendRate=0i,TotalBytesReceived64=51822844130,TotalBytesSent64=96391224596
FritzBox,host=(none),source=dsl
FritzBox,host=(none),source=network ,LocalDNSServer="192.168.178.1",HostNumberOfEntries=33i,HostsKnown=33i,HostsKnownLAN=20i,HostsKnownWLAN=8i,HostsActive=26i,HostsActiveLAN=19i,HostsActiveWLAN=6i
FritzBox,host=(none),source=lan PacketsSent=272780335i,PacketsReceived=343951287i
FritzBox,host=(none),source=wlan_2.4GHz SSID="FRITZ!Box 6591 Cable WK",Channel=6i,ClientsNumber=1i,PacketsSent=18260061i,PacketsReceived=9963893i
FritzBox,host=(none),source=wlan_5GHz SSID="FRITZ!Box 6591 Cable WK",Channel=36i,ClientsNumber=5i,PacketsSent=160847848i,PacketsReceived=77807775i
FritzBox,host=(none),source=wlan_Guest SSID="FRITZ!Box Gastzugang",Channel=6i,ClientsNumber=0i,PacketsSent=0i,PacketsReceived=0i

any fix for that one?

FerFemNemBem commented 3 years ago

Hi,

the only thing I can see is that there seems to be a whitespace behind the "source=wan ". Maybe this confuses the inputs plugin?

I'ts only a guess but it should be worth to adapt the "telegrafFritzBox.py"-script to remove such white spaces and test again.

I'm not that familiar with thy Python stuff but something like: avar = avar.rstrip() right below line 40 could do the trick.

Cheers, Jan

Am 27.03.2021 um 17:23 schrieb acocalypso:

Hi,

I wanted to test it on my FritzBox Cable 6591 and the python script itself executs perfectly fine.

Telegraf anyhow has some metric parse issues

[inputs.exec] Error in plugin: metric parse error: expected field at 3:33: "FritzBox,host=(none),source=wan

I'm on version 7.21

|/home/pi/fritzbox_env/bin/python3 telegrafFritzBox.py -i 192.168.178.1 -p mysupersecretpassword FritzBox,host=(none),source=general ModelName="FRITZ!Box 6591 Cable (kdg)",WANAccessType="Cable",SerialNumber="2C91AB74D85A",Firmware="7.21" FritzBox,host=(none),source=status UpTime=1329942i FritzBox,host=(none),source=wan ,Layer1DownstreamMaxBitRate=57500000i,Layer1UpstreamMaxBitRate=5750000i,ByteReceiveRate=470953i,ByteSendRate=156476i,PacketReceiveRate=0i,PacketSendRate=0i,TotalBytesReceived64=51822844130,TotalBytesSent64=96391224596 FritzBox,host=(none),source=dsl FritzBox,host=(none),source=network ,LocalDNSServer="192.168.178.1",HostNumberOfEntries=33i,HostsKnown=33i,HostsKnownLAN=20i,HostsKnownWLAN=8i,HostsActive=26i,HostsActiveLAN=19i,HostsActiveWLAN=6i FritzBox,host=(none),source=lan PacketsSent=272780335i,PacketsReceived=343951287i FritzBox,host=(none),source=wlan_2.4GHz SSID="FRITZ!Box 6591 Cable WK",Channel=6i,ClientsNumber=1i,PacketsSent=18260061i,PacketsReceived=9963893i FritzBox,host=(none),source=wlan_5GHz SSID="FRITZ!Box 6591 Cable WK",Channel=36i,ClientsNumber=5i,PacketsSent=160847848i,PacketsReceived=77807775i FritzBox,host=(none),source=wlan_Guest SSID="FRITZ!Box Gastzugang",Channel=6i,ClientsNumber=0i,PacketsSent=0i,PacketsReceived=0i |

any fix for that one?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Schmidsfeld/TelegrafFritzBox/issues/8#issuecomment-808757416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARXOQFY3QX7YJ5G4XELTAFTTFYBB5ANCNFSM4WDZCUTA.

acocalypso commented 3 years ago

The output i broken as it's missing a comma sign after the source value:

telegraf,host=(none),source=wan ConnectionTime=391136i,

I will fix that later and check if it's working

FerFemNemBem commented 3 years ago

I'm a little confused. where is: telegraf,host=(none),source=wan ConnectionTime=391136i, from? In your initial post this line looked like: FritzBox,host=(none),source=wan ,Layer1DownstreamMaxBitRate=57500000i,

acocalypso commented 3 years ago

As I have a cable modem i changed it to is dsl false. Sorry for the confusion.

I fixed the comma issue but now I have the following error: E! [inputs.exec] Error in plugin: metric parse error: expected field at 1:62: "telegraf,host=(none),source=general,ModelName="FRITZ!Box 6591 Cable (kdg)",WANAccessType="Cable",SerialNumber="xxxxxxxx",Firmware="7.21""

Here I'm not sure what the issue might be

I replaced my serial number with xxxxxx

FerFemNemBem commented 3 years ago

I had a similar issue with the smart home script. In my case it was the space. a simple: avar = avar.replace(' ','_') has fixed it. Maybe worth to give it a try.

acocalypso commented 3 years ago

thanks, now its working for me

donmahallem commented 3 years ago

Did face similar issues like acocalypso. Partially fixed by my by my PR #12. Additionally I had to replace the DSL flag at the top to false as I am using a Cable Router.