ntopng Interface selection

Started by CJ, January 01, 2024, 07:44:46 PM

Previous topic - Next topic
The community edition of ntopng has a limit of 8 interfaces.  Unfortunately, I have more than 8 interfaces in OPNsense.  Under the advanced options of the plugin there is an option to configure the listening interfaces.  It passes along the --interface option to ntopng. However, the OPNsense UI won't allow you to select more than one interface.  ntopng allows for multiple --interface options to be specified.

Can the UI be configured for multiple selection of interfaces?

The short answer is no. There is an article here: https://forum.opnsense.org/index.php?topic=29151.0 that talks about this. In my implementation, I found a different result. I found the file here: /usr/local/etc/ntopng.conf

I had to ssh to OPNsense, edit the file, and then restart the ntopng service. Stopping and starting the service, curiously, overwrote the file with the default (single) interface. Every time OPNsense restarts, an edit of that file is needed. Candidly, I think it's silly that OPNsense does not allow a multi-select on that field in the UI; I'd almost say it is a bug.

That's what I thought but I wanted to see if anyone had anything I was missing before I submitted it as a bug.

January 25, 2024, 03:03:59 AM #3 Last Edit: February 19, 2024, 04:22:25 PM by 36thchamber
the /usr/local/etc/ntopng.conf is not a meaningful config file, it's a temporary file, generated from the /config/config.xml file on execution. that file is sadly limited to just one interface.

to override the buggy behavior at the moment the gui now supports it in 24.1.1. To do it via script (e.g. modify the order knowning the last items could be variable), modify the RC file the action is calling - /usr/local/etc/rc.d/ntopng:

interfaces="-i bridge0 -i vlan02 -i wg3"
command_args="-U ntopng -G ${ntopng_pidfile} -1 ${httpdocs_path} -2 ${scripts_path} -3 ${callbacks_path} -e ${interfaces}"


since installation overwrites all of the configs, it's even better to slap the code into a unique RC startup file 49-ntopngfix:

sed -i -e 's/^\(command_args.*-e\)\"/\1 -i bridge0 -i vlan03 -i wg3\"/' /usr/local/etc/rc.d/ntopng

another iisue is the certificate doesn't get refreshed.

i wish ntop was incorporated into GUI like Zen, or, have a link somewhere in Lobby.