[Nfsen-discuss] Re: Problems using old nfdump data -- patch
Netflow visualisation and investigation tool
Brought to you by:
phaag
|
From: Jason C. <jch...@uc...> - 2006-04-07 22:39:53
|
I saw this discussion before I signed up to the list, otherwise I would have replied earlier. I did have the same problem with importing prior flow sources and developed a small patch to fix it. As I understand it, the problem is the start time for the RRD files needs to be adjusted to the date your flow data begins. Example and patch below. -- Jason ########--example after install.pl is patched--######### (...) Profile live: spool directories: Creating: darknet Are you importing exisiting flow data? Y or N: y Enter the number of days prior to now your flow records start: 4 Adjusting RRD start time by 4 days -- 345600 seconds, epoch time: 1144096937 Create profile info for profile 'live' Setup done. * You may want to subscribe to the nfsen-discuss mailing list: * http://lists.sourceforge.net/lists/listinfo/nfsen-discuss * Please send bug reports back to me: pet...@sw... ######--patch--###### kyushu:~/Downloads/nfsen-1.2.4> patch -u < patch--install patching file install.pl kyushu:~/Downloads/nfsen-1.2.4> kyushu:~/Downloads/nfsen-1.2.4> cat patch--install --- install.pl 2006-04-07 14:00:21.000000000 -0700 +++ install-new.pl 2006-04-07 13:45:42.000000000 -0700 @@ -446,7 +446,30 @@ RenameFiles(); + my $now = time(); + + print "Are you importing exisiting flow data? Y or N: "; + my $var = <STDIN>; + chomp($var); + if ( $var =~ /^(Y|y)$/) { + print "Enter the number of days prior to now your flow records start: "; + my $days = <STDIN>; + chomp($days); + $days =~ /\d+/; + + if ( $days > 0 && $days < 1825 ) { + my $temp_time = ($days*24*60*60); # Days * 24 hrs * 60 minutes * 60 seconds + $now -= $temp_time; + print "Adjusting RRD start time by $days days -- $temp_time seconds, epoch time: $now \n"; + } + else { + print "The number of days is 0, greater than 5 years, or not valid.... using the current time\n"; + $now = time(); + } + } + + my $tstart = $now - ( $now % 300 ); NfSenRRD::SetupRRD("$NfConf::PROFILESTATDIR/live", $tstart - 300, 0); if ( $Log::ERROR ) { |