Hi,

its because RRD database is configured to store values older than 30
days with longer granularity. You can modify the granularity in
NfSenRRD.pm by changing the following function. Than reload nfsen. Than
new created profiles will be stored for 6 months with 5 minutes
granularity. The size of RRD database will increase to 15MB.

sub SetupRRD {

    my $path    = shift;
    my $db        = shift;
    my $start     = shift;
    my $force    = shift;

    $Log::ERROR = undef;
    my @DS;
    foreach my $ds ( @RRD_DS ) {
        push @DS, "DS:$ds:ABSOLUTE:600:U:U";
    }

    my $ERR;

    # Create the RRD DB only if it not exists, or we are forced
    # to delete the old one, and create a new one
    unlink "$path/$db.rrd" if $force;
    if ( -f "$path/$db.rrd" ) {
        print  "RRD DB '$db.rrd' already exists!\n";
        return;
    }
   
    # New RRD DB layout:
    #   1 x 5min =  5 min samples 6 * 30 * 288 = 51840 => 6 * 30 days
    #   6 x 5min = 30 min samples 6 * 30 *  48 = 8640  => 6 * 30 days
    #  24 x 5min = 2 hour samples 6 * 30 *  12 = 2160  => 6 * 30 days
    # 288 x 5min = 1 day samples 5 * 365 *   1 = 1825  => 5 * 365 days
    # RRD DB layout:
    #   1 x 5min =  5 min samples     30 * 288 ( per day ) = 8640 => 30 days
    #   6 x 5min = 30 min samples      30 *  48 ( per day ) = 1440 => 30
days   
    #  24 x 5min =  2 hour samples      30 *  12 ( per day ) = 360  =>
30 days
    # 288 x 5min =    1 day samples    700 *   1 ( per day ) = 700  =>
700 days
    # Total data available 790 days
    my $old_umask = umask 0002;
    my $rrd_filename = "$path/$db.rrd";
    RRDs::create ( $rrd_filename, "--start", $start,
        @DS,
        "RRA:AVERAGE:0.5:1:51840",
        "RRA:AVERAGE:0.5:6:8640",
        "RRA:AVERAGE:0.5:24:2160",
        "RRA:AVERAGE:0.5:288:1825",
        "RRA:MAX:0.5:1:51840",
        "RRA:MAX:0.5:6:8640",
        "RRA:MAX:0.5:24:2160",
        "RRA:MAX:0.5:288:1825"
    );   
#    RRDs::create ( $rrd_filename, "--start", $start,
#        @DS,
#        "RRA:AVERAGE:0.5:1:8640",
#        "RRA:AVERAGE:0.5:6:1440",
#        "RRA:AVERAGE:0.5:24:360",
#        "RRA:AVERAGE:0.5:288:700",
#        "RRA:MAX:0.5:1:8640",
#        "RRA:MAX:0.5:6:1440",
#        "RRA:MAX:0.5:24:360",
#        "RRA:MAX:0.5:288:700"
#    );
    umask $old_umask;

    $ERR=RRDs::error;
    if ( $ERR ) {
        $Log::ERROR = "ERROR while creating RRD DB $db.rrd: $ERR";
    }
    # System Errors are not reported detailed enough, so report system
errno, if
    # file does not exists or is empty
    if ( !-f $rrd_filename || -z $rrd_filename ) {
        my $err = $!;
        warn "Unable to create DB file: $err\n";
        if ( !defined $Log::ERROR) {
            $Log::ERROR = "Unable to create DB file: $err";
        }
    }

} # End of SetupRRD


    Jan

Jan Pazdera <pazdera at invea.cz>
INVEA-TECH a.s.
U Vodarny 2965/2, 61600 Brno, Czech Republic
Tel: +420 511 205 251
www.invea-tech.com
Key 0x89F62F78: 41A7 28C2 C624 FBD1 E236  6827 42EB 3694 89F6 2F78



On 18.10.2012 10:29, Arnaud Lauriou wrote:
> Hello,
>
> We use nfsen 1.3.6p1.
>
> When displaying graph older than one month, nfsen is generating wrong data.
>
> Examples for the live profile when looking at 09/16/2012 day (generated
> graph is attached) :
> - nfcap files are presents
> - live profile never expire
> - nfdump is still working on those data
> - No error fond in the apache log file when those graphs are generated
>
> Do you have an idea why graphs older than one month are badly generated ?
>
> Regards,
>
> Arnaud
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
>
>
> _______________________________________________
> Nfsen-discuss mailing list
> Nfsen-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nfsen-discuss
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Nfsen-discuss mailing list
Nfsen-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to