mbolli / nfsen-ng

Responsive NetFlow visualizer built on top of nfdump tools.
Apache License 2.0
232 stars 44 forks source link

Support for custom NfDump #35

Closed nrensen closed 4 years ago

nrensen commented 4 years ago

This diff adds support for custom NfDump implementation by specifying an nfdump class in settings (similarly to the way custom databases are supported). I use this to allow nfsen-ng to run in a php chroot without direct access to the nfcapd files. The original nfsen supports this.

My custom nfdump model (not included here), which is similar to the original nfsen, is to run a separate nfsend daemon and have nfsen-ng communicate via a fifo. This could also work using a socket which would allow nfsen-ng to run on a different host from that where the nfcapd files reside.

You may consider this too obscure to support within the nfsen-ng code base, although the additional complexity is minimal. If you are concerned that existing nfsen-ng users will be required to add the nfdump entry in the general settings then I can alter NewNfDump() to default to the normal nfsen-ng NfDump implementation if there is no nfdump class specified in settings.

mbolli commented 4 years ago

I support the general case made here, a few points:

I could probably do the first two, although you'd need to rebase...

nrensen commented 4 years ago

Thanks for your comments, all very reasonable. I will work towards a diff that meets those requirements.

Thanks also for your responsiveness in general. I have a few other little things that I am working on for nfsen-ng. I am also planning on trying to get a diff accepted into nfdump to include fl (number of flows) and the ...per second metrics added to the csv output so that they are available to nfsen-ng.

nrensen commented 4 years ago

Instead of adjusting this branch, it is more convenient for me to create a new pull request from a new branch addressing the comments above.