Aha!

In /usr/local/www/status_rrd_summary.php, on line 38, the requested resolution 
for $lastmonth is 86400, but the RRD file in question doesn't have anything 
larger than 720*60=43200 (according to "rrdtool info", anyway) and defaults to 
returning not the next-closest resolution, but the *highest* resolution 
instead.  I haven't checked "this month", but the "last month" numbers match my 
ISP bill perfectly if I change "86400" to 720*60:

__BOF__
--- status_rrd_summary.php      2010-07-13 14:18:21.000000000 -0500
+++ status_rrd_summary.php.orig 2010-07-13 14:05:36.000000000 -0500
@@ -33,9 +33,9 @@
 $lastmonth = "00 " . date("m/{$startday}/Y", strtotime("-1 month", 
strtotime(date("m/{$startday}/Y"))));

 $thismonth = fetch_rrd_summary($rrd, $start, "now");
-$lastmonth = fetch_rrd_summary($rrd, $lastmonth, $start, 720*60);
+$lastmonth = fetch_rrd_summary($rrd, $lastmonth, $start, "86400");

-function fetch_rrd_summary($rrd, $start, $end, $resolution=(60*60)) {
+function fetch_rrd_summary($rrd, $start, $end, $resolution="3600") {
        $traffic = array();
        $rrd   = escapeshellarg("/var/db/rrd/{$rrd}");
        $start = escapeshellarg($start);
__EOF__

-Adam Thompson
 Chief Technical Architect, C3A Inc.
 athom...@c3a.ca
 (204) 272-9628 / fax: (204) 272-8291


> -----Original Message-----
> From: Adam Thompson [mailto:athom...@c3a.ca]
> Sent: Tuesday, July 13, 2010 1:25 PM
> To: 'support@pfsense.com'
> Subject: RE: [pfSense Support] Bandwdith usage since start of month?
> 
> Checking it against my latest ISP bill, the numbers are way out.  ISP is
> billing me for 57.4GBytes, RRD Summary page shows last month as
> In:108921, Out:8602, Total:117523.  I do note that the Total number is
> *almost* double the ISP's number - which seems to correspond with
> David's observations from July 5th (included below).
> 
> -Adam Thompson
>  Chief Technical Architect, C3A Inc.
>  athom...@c3a.ca
>  (204) 272-9628 / fax: (204) 272-8291
> 
> 
> > -----Original Message-----
> > From: David Burgess [mailto:apt....@gmail.com]
> > Sent: Monday, July 05, 2010 6:18 AM
> > To: support@pfsense.com
> > Subject: Re: [pfSense Support] Bandwdith usage since start of month?
> >
> > On Thu, Jun 24, 2010 at 2:12 PM, Jim Pingle <li...@pingle.org> wrote:
> >
> > > Give it a try and see if it's still accurate.
> >
> > Some observations:
> >
> > 1. Using the June 23 nanobsd snapshot, RRD Summary reported
> ~330GB of
> > traffic from June 1 to June 30. On July 3 it reported over 700GB of
> > traffic from the 1st. In other words it appeared that it not only
> > failed to reset its counter on July 1, but it had also somehow doubled
> its count.
> >
> > 2. I just updated to the July 4 snapshot and saw this on the console
> > after the automatic reboot:
> >
> > "
> > Syncing packages: RRD Summary
> > Beginning package installation for ...
> > Removing package...
> > Removing RRD Summary components...
> >
> > Warning: fwrite(): 63 is not a valid stream resource in /etc/inc/pkg-
> > utils.inc on line 816
> >
> > Beginning package installation for ...
> >
> > Syncing packages:.
> > Executing rc.d items...
> >  Starting /usr/local/etc/rc.d/*.sh...done.
> > Bootup complete
> > "
> >
> > When attempting to load the dashboard for the first time it instead
> > loaded one of the package pages where I saw something like "All
> > packages reinstalled", but it appears the RRD Summary package is not
> > installed.
> >
> > 3. I manually installed RRD Summary again from the UI. Now it is
> > reporting 50GB used since the 1st, which is not unlikely, and 772GB
> > for last month, which, as I stated, is more than double the amount it
> > was reporting only a day or two or three from the end of June, and is
> > therefore unlikely.
> >
> > db
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: support-unsubscr...@pfsense.com For
> additional
> > commands, e-mail: support-h...@pfsense.com
> >
> > Commercial support available - https://portal.pfsense.org

Reply via email to