[ previous ] [ next ] [ threads ]
 
 From:  "ALFREDO GONZALEZ" <got2go at msn dot com>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  RE: [m0n0wall] Status: Inteface question
 Date:  Sat, 30 Oct 2004 21:06:11 +0000
Hello,

1- The numbers reset back to zero after 4294967295. it is not a bug, but a 
limit on the 32bit counters used. You will find this in pretty much any 
system that uses 32bit counters.

2- For total traffic, you could write some scripot to query the SNMP 
interface/counter every 5 minutes or so. Basically, every time the script 
runs, it reads the counter values from the interface, then calculates the 
delta from the last value, if the delta is negative, then the counter has 
re-set, so  then add the current value to the difference between the last 
value and 4294967295. Then write this number down. Perhaps as variables in a 
text file.

Example for a few collected samples:

5 min Samples | (calculation) = Total transfer
1294967295 | 1294967295 = 1294967295
2294967295| (2294967295 - 1294967295) = 1000000000
3294967295 | (3294967295 - 2294967295) = 1000000000
4294900000 | (4294900000 - 3294967295) = 999932705
4574398 | (4294967295 - 4294900000)+ 4574398 =
9574398 | (9574398 - 4574398 ) = 5000000

Notice the line where the counter reset/wraped. You need to detect for this 
in the script and do the proper calculations.

You also need to query the SNMP counter for system uptime, so you can detect 
if the system has been rebooted since the last counter reading. Counters are 
also reset on reboot of the device.

This is just a brief explanation on these. I dont see this as being too 
difficult to implement in a basic script.

HTH

Got2Go


>From: "The Unwanted" <no dot emails dot plz at netvisao dot pt>
>To: <m0n0wall at lists dot m0n0 dot ch>
>Subject: [m0n0wall] Status: Inteface question
>Date: Sat, 30 Oct 2004 20:58:55 +0100
>
>Greetings,
>
>I've been using m0n0wall since v1.0 and I'm currently using v1.1
>generic-pc-cdrom (it's more easy for me to manage, just write it an RW)
>
>I normally avoid using the beta versions, so I don't if this has been
>ajourned or not.
>
>I have a cable connection WITH transfer limits unfortunalty, therefore it 
>is
>important to me to keep track of how many bytes as transfered in and out on
>a monthly basis.
>
>On my personal PC I use DUmeter but this has two big drawbacks:
>     1 - Not all traffic comes from my PC (altought the vast majority does)
>     2 - Not all traffic from my PC goes to the WAN interface (for example,
>PC to PC comunications inside the LAN).
>
>I can check these stats on my ISPs homepage, but they sometimes make
>mistakes and I like to keep track of it from my side.
>
>For this purpose I use the Status: Interfaces page on m0n0wall as there is
>an "In/Out Packets" item per each interface that also gives the byte count.
>Looking at the WAN interface it should give the total packets and bytes In
>and Out of the WAN interface.
>
>The problem is that, altough m0n0wall hasn't been reset or made a reboot 
>for
>a long time now, from time to this value is reset to 0 and started over.
>
>To sum it; I have to questions:
>
>1 - At which vale does this item reset? Is it a bug? Is it solved or going
>to be?
>2 - Is it possible to somehow include a small functionality inside m0n0wall
>to perform similar to DUmeter, so the total traffic can be accounted?
>
>The second question is more of a "whishlist" request than else.
>
>Thanks
>Pedro
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.786 / Virus Database: 532 - Release Date: 29-10-2004
>