Custom startup line for the ntopng package



  • Hello,
    I have seen a few requests which require some modification to the ntopng startup line. I would like to export to elasticsearch and need to add an additional config flag at startup. I was wondering if it would be possible to add a box in the package which allows the addition of custom lines (like the advanced config option in openvpn).

    My research seems to suggest this should be possible given this helpful post
    @master007:

    I wanted to check out the config file too… Didn't find ntopng.conf.
    The package uses a different method to configure that service in pfSense.

    Here is what I found:
    there is 2 files related to ntopng in
    /usr/local/pkg/ntopng.inc
    /usr/local/pkg/ntopng.xml

    This file :/usr/local/pkg/ntopng.inc seems to have all the logic for configurations included.
    and seems to start ntopng on the fly with config parameters based on the the xml config file / web page

    It starts something like this
    (after looking at ps -A)
    /usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -s -e -w 0 -W 3000 -i em1 --dns-mode 0 --local-networks 192.168.0.0/16,172.16.0.0/12,10.0.0.0/8

    Perhaps that info helps you further...

    in the .xml file it seems pretty straight forward to add a box that would show up in the ntopng settings page and take the custom line. That field then just needs to read and added to the startup line in /usr/local/etc/rc.d/ntopng.sh when it is auto generated by the service handler.

    Im a fair noob so that's about as far as I could get, any help would be appreciated, and it seems this would help a number of other people too. What is actually building the /usr/local/etc/rc.d/ntopng.sh file. I assume it is run everytime save is pushed?

    Cheers