NfProfile::DoRebuild expects $socket as first parameter but only in one case the
variable will be provided to the method.
grep -nr DoRebuild .
./libexec/NfProfile.pm:1189:sub DoRebuild {
./libexec/NfProfile.pm:1450:} # End of DoRebuild
./libexec/NfProfile.pm:2947: my $status = DoRebuild($socket, \%profileinfo,
$profile, $profilegroup, $profilepath, 0, $RebuildGraphs);
./libexec/NfProfile.pm:3444: my $status =
DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
./libexec/NfProfile.pm:3456: my $status =
DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
./install.pl:556:
NfProfile::DoRebuild(\%profileinfo,
$profilename, $profilegroup, $profilepath, 1, 0);
I guess there is no highly demand for $socket in DoRebuild at all because
actually it will be used only once for printing in the line 1346
print $socket ".info Rebuilding Profile '$profile': Completed:
$completed\%\n";
Same message will sent to the syslogger in the next line.
DoRebuild calls without $socket might end in exception by assigning
$$profileinfo{'size'}:
Can't use string ("live") as a HASH ref while "strict refs" in use at
libexec/NfProfile.pm
Therefor I would suggest to remove $socket variable from the
NfProfile::DoRebuild arguments.
I did it for myself here:
https://github.com/p-alik/nfsen/commit/98bf068eb78cf8e5acdfdb2ebdd3cdf11d164869
Cheers,
Alexei
> On 08 June 2016 at 22:02 Yannick D'Amboise <[email protected]> wrote:
>
>
> Hi Alexei,
>
> Thank you very much for taking some of your time to make those changes and
> pointing me to them.
>
> I will test those changes and will let you know how it goes.
>
> In the meantime, I have two questions:
>
> 1. In NfSenRRD.pm, the change made to line 121 (adding "--step",
> $NfConf::CYCLETIME) is not repeated on line 174 which has the exact same code:
> when I hardcoded the value for step, I did it on both lines and I wonder if I
> had had gone too far by doing this. Your input (or anyone else's) is more than
> welcome on this.
> 2. Also in NfSenRRD.pm on line 99 and 160 (line numbers might vary slightly),
> I had hardcoded the heartbeat value in push @DS,
> "DS:$ds:ABSOLUTE:600:U:U"; to push @DS, "DS:$ds:ABSOLUTE:120:U:U";
> . It might be useless or undesirable: I value your input and advice in
> advance regarding this as well .
>
> Thank you again for these changes that go far beyond what I had hardcoded.
>
> Regards,
>
> Yannick
>
>
> -----Original Message-----
> From: Alexei Pastuchov [mailto:[email protected]]
> Sent: Wednesday, June 08, 2016 10:26 AM
> To: Yannick D'Amboise; [email protected]
> Subject: Re: [Nfsen-discuss] Unexact results in Shadow profile Statistics
> timeslot after changing CYCLETIME value
>
> Hi Yannick,
> CYCLETIME is an issue in my case too.
> So I patched nfsen implementation and actually graphs in unpatched and patched
> versions look absolutely equal.
> I think this line could contains a solution you are looking for.
> https://github.com/p-alik/nfsen/blob/master/libexec/NfSenRRD.pm#L121
>
> Cheers,
> Alexei
>
> > On 02 June 2016 at 22:55 Yannick D'Amboise <[email protected]>
> > wrote:
> >
> >
> > Hi,
> >
> > As added details, here is my set-up:
> >
> > - OS: CentOS 7
> > - NFSEN: nfsen-1.3.7
> > - NFDump: nfdump-1.6.13
> >
> > I've googled about my issue and found very few things; I've searched
> > the mailing list and found only something regarding value that are not
> > exact when looking at results in the past but this is expected as data
> > is being averaged the further back in time they are. I also found a
> > post regarding changing polling interval stating that changing
> > CYCLETIME should mostly do it and that NFSen 1.3.7 should already be
> > flexible (I'm running 1.3.7).
> >
> > I've changed all the instance of the hard-coded "300"including
> > CYCLETIME value I could find in the in the NFSen directory and looked
> > for instances under other possible names without success; if anyone
> > can point me to something I missed, I'd be more than happy.
> >
> > I created a XML file of the content of the RRD using RRDDump to look
> > at the data itself and could confirm that there was a variation every
> > 60 seconds so my guess is that the config changes I made to
> > NfSenRRD.pm were correct; there probably is a better way of getting
> > data from the database but I'm new to RRD so please forgive my ignorance.
> >
> > I also had a look at the logs (/var/log/messages) and I see a lot of
> > NFSen NFCapd, etc messages, but no errors.
> >
> > Please note that I have no experience with Perl nor PHP, my background
> > in coding helps me a bit when looking at the code but is somewhat
> > limited also so I might have missed something obvious. I've been
> > through details.php (in the NFSen WWW folder) and could trace a few
> > things but my limited knowledge stops me at some points. I get to the
> > following line (1203) in the file:
> >
> > $_val = ScaleBytes($statinfo['traffic' . $_type], $rateval, 1000.0);
> >
> > But then I get lost when tracking "$rateval". I find this
> >
> > $rateval = $_SESSION['tright'] - $_SESSION['tleft'] + $CYCLETIME;
> >
> > At line 1139, but I'm not able to interpret it. Any hint would be welcome.
> >
> > Obviously, shadow profiles are really useful as they eat less disk
> > space and that's why I'm trying to make this work.
> >
> > English not being my native language, please excuse any ambiguity.
> >
> > Thank you very much for your help and support. Any and all help is
> > deeply appreciated.
> >
> > Regards,
> >
> > Yannick
> >
> >
> > ----------------------------------------------------------------------
> > -------- What NetFlow Analyzer can do for you? Monitors network
> > bandwidth and traffic patterns at an interface-level. Reveals which
> > users, apps, and protocols are consuming the most bandwidth. Provides
> > multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make
> > informed decisions using capacity planning reports.
> > https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> > _______________________________________________
> > Nfsen-discuss mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nfsen-discuss
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss