0

I am asked to modify a default clean nfsen-1.3.6p1 install to to collect and poll every 30 seconds.

I "patched" libexec/NfSenRC.pm's nfdump command arguments that it uses to -w -D -t 30 -p $port -u $uid -g $gid $buffer_opts $subdirlayout -P $pidfile $ziparg $extensions (-t 30) and the capture data is updated every 30 seconds but I don't know how and where to change the RRD resolution (yes I appreciate that the rrds will need recreating) and the way they're used.

Also changed other 300 second hardcoded values and if statements in the other modules in libexec/

And also how to change the web interface to allow display of all these changes, currently it still locks to at least 5 minutes ago when checking the most recent values in a graph

Recct
  • 370
  • 1
  • 3
  • 22

1 Answers1

0

So it can be "patched" to do that and it does seem to work. The below achieves the aim but of course has lots of room for improvement such as exposing this as perhaps an installation directive and have many other tweaks.

In it's default install dir /data/nfsen/ you have you find instances of the hardcoded 300 or sec steps, windows, slices etc, same for the occurrences in the web dir /var/www/nfsen

More notable changes are in libexec/NfSenRRD.pm to change the RRD create command First the data sources definition changed to

push @DS, "DS:$ds:ABSOLUTE:60:U:U";

and below that to add the "step" argument for rrdtool

RRDs::create ( $rrd_filename, "--start", $start, "--step", 30, (The RRA parameters can be tweaked to your needs here too)

If you had .rrds created they need to be remade, you can do that by removing your capture definitions in the main config file, running perl nfsen reconfig then putting them back in.

in libexec/NfSenRC.pm the arguments for the nfcapd command need changing to my $common_args = "-w -D -t 30 -p $port -u $uid -g $gid $buffer_opts $subdirlayout -P $pidfile $ziparg $extensions"; (include -t 30)

For good measure I compiled the latest NFDUMP and pointed nfsen to the new binaries.

Now back in the webdir in details.php $WinSizeScale needs to be tweaked as well. Luckily those are well commented so you can work out what values to put to accommodate the hack.

Loads of room for improvement and customisation here too.

Recct
  • 370
  • 1
  • 3
  • 22