Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload/Download Counters reset every 4GB #19

Closed
detlevo opened this issue May 15, 2020 · 8 comments
Closed

Upload/Download Counters reset every 4GB #19

detlevo opened this issue May 15, 2020 · 8 comments

Comments

@detlevo
Copy link

detlevo commented May 15, 2020

The total upload and download counters are reset to 0 whenever they reach 4GB. What can be done about this?

@tillepille
Copy link

This is a problem of the fritzbox API.
The counter resets, the closest I got was 4289894889 bytes. Which is conspiciously close to an uint32.
But what I can see at my 6490 is a parameter called NewX_AVM_DE_TotalBytesReceived64 which seems to be a more reasonable value since boot.

@mxschmitt I do not get how the parsing of the SOAP response exactly works, For me the corresponding field for gateway_wan_bytes_received is named NewTotalBytesReceived but I don't see this keyword anywhere in the code.
Maybe you can help out?

@nachfuellbar
Copy link

nachfuellbar commented Feb 5, 2021

@tillepille
https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/IGD1.pdf

He uses the Action GetAddonInfos which is described in the pdf

Action: "GetAddonInfos",
Result: "TotalBytesReceived",

I think you are probably right with your assumption about using NewX_AVM_DE_TotalBytesReceived64 - the corrospondending variable would be X_AVM_DE_TotalBytesReceived64

The same goes for

Action: "GetAddonInfos",
Result: "TotalBytesSent",

which should probably be X_AVM_DE_TotalBytesSent64

@mxschmitt
Copy link
Owner

fixed in #22

@nachfuellbar
Copy link

I tried your updated image and it's not working for me - metrics say 0 for the received and sent values

gateway_wan_bytes_receive_rate{gateway="fritz.box"} 118485
gateway_wan_bytes_received{gateway="fritz.box"} 0
gateway_wan_bytes_send_rate{gateway="fritz.box"} 13387
gateway_wan_bytes_sent{gateway="fritz.box"} 0
gateway_wan_connection_status{gateway="fritz.box"} 1
gateway_wan_connection_uptime_seconds{gateway="fritz.box"} 52596
gateway_wan_layer1_downstream_max_bitrate{gateway="fritz.box"} 2.85305e+08
gateway_wan_layer1_link_status{gateway="fritz.box"} 1
gateway_wan_layer1_upstream_max_bitrate{gateway="fritz.box"} 4.441e+07
gateway_wan_packets_received{gateway="fritz.box"} 1.209051e+06
gateway_wan_packets_sent{gateway="fritz.box"} 5.960714e+06

Is this only happening for me?
I thought of some possibilities why this would happen:

  1. documentation is obsolete (says it's for fritz os 6.93 but i'm using the most recent version)
  2. we need to change something else too
  3. some unique error on my side

Buuuuut
IDK
After querying the upnp interface i got following output which seems like my PR should have been correct

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetAddonInfosResponse xmlns:u="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1">
<NewByteSendRate>9893</NewByteSendRate>
<NewByteReceiveRate>19429</NewByteReceiveRate>
<NewPacketSendRate>0</NewPacketSendRate>
<NewPacketReceiveRate>0</NewPacketReceiveRate>
<NewTotalBytesSent>2416823644</NewTotalBytesSent>
<NewTotalBytesReceived>1461669881</NewTotalBytesReceived>
<NewAutoDisconnectTime>0</NewAutoDisconnectTime>
<NewIdleDisconnectTime>1</NewIdleDisconnectTime>
<NewDNSServer1>217.237.148.102</NewDNSServer1>
<NewDNSServer2>217.237.151.115</NewDNSServer2>
<NewVoipDNSServer1>217.237.148.102</NewVoipDNSServer1>
<NewVoipDNSServer2>217.237.151.115</NewVoipDNSServer2>
<NewUpnpControlEnabled>0</NewUpnpControlEnabled>
<NewRoutedBridgedModeBoth>1</NewRoutedBridgedModeBoth>
<NewX_AVM_DE_TotalBytesSent64>2416823644</NewX_AVM_DE_TotalBytesSent64>
<NewX_AVM_DE_TotalBytesReceived64>18641539065</NewX_AVM_DE_TotalBytesReceived64>
<NewX_AVM_DE_WANAccessType>DSL</NewX_AVM_DE_WANAccessType>
</u:GetAddonInfosResponse>
</s:Body>
</s:Envelope>

@nachfuellbar
Copy link

nachfuellbar commented Feb 8, 2021

Small update
I build the binary on my client and with this binary i get non zero values for X_AVM_DE_TotalBytesSent64 and X_AVM_DE_TotalBytesReceived64

Can somebody verify if the docker container is working for them?

Edit: correct the values to the right ones - accidentially used the prometheus ones ;)

@mxschmitt
Copy link
Owner

mxschmitt commented Feb 8, 2021

I will revert the last commit. a7c9b2a

Should be fixed on DockerHub in a few minutes.

@mxschmitt mxschmitt reopened this Feb 8, 2021
@nachfuellbar
Copy link

Sample Output from ./exporter -stdout for me

  GetAddonInfos
    ByteSendRate: 4904
    ByteReceiveRate: 2758
    PacketSendRate: 0
    PacketReceiveRate: 0
    TotalBytesSent: 3265010469
    TotalBytesReceived: 338633081
    AutoDisconnectTime: 0
    IdleDisconnectTime: 0
    DNSServer1: 217.237.148.102
    DNSServer2: 217.237.151.115
    VoipDNSServer1: 217.237.148.102
    VoipDNSServer2: 217.237.151.115
    UpnpControlEnabled: false
    RoutedBridgedModeBoth: 1
    X_AVM_DE_TotalBytesSent64: 3265010469
    X_AVM_DE_TotalBytesReceived64: 17518502265
    X_AVM_DE_WANAccessType: DSL

@nachfuellbar
Copy link

New pull request available
AVM formats both as a string which was the source of the problem

PR #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants