David,

If you are happy with Netstat/darkstat there is a way to save and reload that 
data to persistent storage.  Years ago this caused issues, but may work today, 
and with a rc.conf variable option to enable it.

Without looking, basically the darkstat.init needs to be tweaked.

Lonnie




> On Jan 26, 2021, at 10:45 AM, David Kerr <da...@kerr.net> wrote:
> 
> ifconfig/ip -s probably reports closest to what the ISP is metering.
> And I assume that is what Netstat/darkstat is measuring.  But the data
> on that tab is reset every reboot. I assume the interface RX/TX bytes
> are reset to zero on boot (and/or on taking the interface down/up).  I
> would need to make sure to capture the values on shutdown... and maybe
> at regular intervals.  Any suggestions on how to capture final values
> as an interface is shutdown?
> 
> Measuring in iptables might provide more granularity, but may not map
> as closely to the raw data comcast measure.
> 
> David
> 
> On Tue, Jan 26, 2021 at 10:57 AM Lonnie Abelbeck
> <li...@lonnie.abelbeck.com> wrote:
>> 
>> 
>> 
>>> On Jan 26, 2021, at 8:29 AM, Michael Keuter <li...@mksolutions.info> wrote:
>>> 
>>> 
>>> 
>>>> Am 26.01.2021 um 15:08 schrieb David Kerr <da...@kerr.net>:
>>>> 
>>>> As some of you may be aware, Comcast / Xfinity are starting to impose
>>>> monthly data caps on internet usage.  Where I live it is 1.2TB a
>>>> month.  So I just received the dreaded "You have used 75% of your
>>>> allowance" email.  Fortunately only 5 days from the end of the month,
>>>> but looking back there are months that I have exceeded the cap.
>>>> 
>>>> Can I do anything in Astlinux to meter usage myself?  I would want to
>>>> monitor raw traffic in and out on eth0, the totals would need to
>>>> survive reboot, I would want to reset on the first of each month and
>>>> maintain a history.  For extra credit... be able to identify high
>>>> users on my internal network(s).
>>>> 
>>>> Any ideas?  Have any other gateways (like OpenWRT) tackled this?
>>>> 
>>>> Thanks
>>>> David
>>> 
>>> Hi David,
>>> 
>>> most applications that I know use RRDtool (a Round-Robin-database to store 
>>> data/measurements) as its basis, like Munin, Cacti, MRTG etc.
>>> 
>>> https://en.wikipedia.org/wiki/RRDtool
>>> 
>>> It is also available in BR2.
>>> Years ago I had hacked myself a Munin node (client) for AstLinux, so data 
>>> could fetched from a Munin server on Debian in my network from my AstLinux 
>>> boxes. But it does not work anymore or I forgot about it. But it created 
>>> nice progress graphicss for some parameters (CPU load, traffic, Asterisk 
>>> calls, etc.).
>>> 
>>> Now since we're using SSDs instead CF cards it would be nice to have such 
>>> application.
>>> My 2 cts.
>>> 
>>> Michael
>> 
>> If we are mostly interesting in network info:
>> 
>> ip -s link show dev eth0
>> --or--
>> ifconfig eth0
>> 
>> provides network interface usage.  On shutdown and/or regular cron this info 
>> would need to be saved to persistent storage along with the sample date.
>> 
>> Though corner cases when the eth0 link goes down or a PPPoE ppp0 interface 
>> comes and goes can make pure interface monitoring less accurate.
>> 
>> An AIF plugin could be added to do something similar, which would be 
>> required if forwarded LAN -> WAN traffic was to be recorded.  Though the 
>> matching WAN -> LAN traffic might be a little tricky.
>> 
>> Then the little matter of what the ISP says the data is vs. your actual data.
>> 
>> Lonnie
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Astlinux-users mailing list
>> Astlinux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/astlinux-users
>> 
>> Donations to support AstLinux are graciously accepted via PayPal to 
>> pay...@krisk.org.
> 
> 
> _______________________________________________
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.
> 
> 



_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to