As a sidenote,

> As soon as you do averaging over more a longer period of time, values get 
> inaccurate by the nature of RRD. This type of
> calculation is done anyway only for shadow profiles. Real profiles are 
> accurate all the time, as data is read from the
> flow files. Shadow profiles do not have any data associated other than the 
> RRD files for the graphs. If you need more
> accurate information for shadow profiles, you would need to extend the RRD 
> layout in NfSenRRd.pm => SetupRRD.
> 
> Shadow profiles come at the price of having no data assigned. This is the 
> good and the bad news.
> 
>       - Peter
> 
> Steve Foley wrote:
>> Yes, I know the RRDs will dither data over time and it does average down
>> as data ages, but I think being off by 2 orders of magnitude when I jump
>> between new data and old data (a difference of 1 day) is a bit much.
> 
>> Digging through the code, I see the following in the ReadRRDStatInfo()
>> function in NfProfile.pm:
> 
>>         foreach my $line (@$data) {
>>                 my $i = 0;
>>                 foreach my $val (@$line) {
>>                         if ( defined $val ) {
>>                                 $$statinfo{$$names[$i++]} += int(300 *
>> $val);
>>                         }
>>                 }
>>         }
> 

instead of parsing all the lines (I assume this code is re-used from the
way reading the 300s-interval-flowfiles works), what usually is a good
approximation for the traffic in rrd is taking the average rate for a
timeframe (which rrd will at least generate in it's graphs) and simply
multiply that by (timeframe_end - timeframe_start in seconds).


e.g. (from one of my internal, non-nfsen rrds which house 4 counters in
one rrd):

rrdtool fetch 1174242.rrd AVERAGE -r 86400 -s '04.02.2009' -e
'05.02.2009'                     ifInOctets       ifInUcastPkts
ifOutOctets      ifOutUcastPkts

1233792000: 1.8195454947e+06 2.6009227659e+03 1.5348825964e+06
2.4793893527e+03
1233878400: 1.6667955888e+06 2.4136770793e+03 1.5536676836e+06
2.4683150875e+03

looking at ifOutOctets, the average is ~1.54e+06 octets per second
(remember rrd always saves rates), multiplied by 86400 gives ~123 GB for
the day. That's not perfect, but the error is around 5% from the actual
data, and not orders of magnitude.

Kind regards,

Felix


-- 
Felix Schüren
Head of NOC

------------------------------------------------------------------
Host Europe GmbH - http://www.hosteurope.de
Welserstraße 14 - D-51149 Köln - Germany
Telefon: (0800) 4 67 83 87 - Telefax: (01805) 66 32 33
HRB 28495 Amtsgericht Köln - UST ID DE187370678
Geschäftsführer:
Uwe Braun - Alex Collins - Mark Joseph - Patrick Pulvermüller

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Nfsen-discuss mailing list
Nfsen-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to