Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ntopng development

    Scheduled Pinned Locked Moved Traffic Monitoring
    83 Posts 28 Posters 36.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Cino
      last edited by

      I was able to get mysql historical data to work.

      I changed file /usr/local/pkg/ntopng.inc line 123 to something like this

      
      	/* Historical Data Storage, Dump expired flows */
      	if ($ntopng_config['dump_flows'] == "on") {
      		$dump_flows = "-F 'mysql;mysql.server;ntopng;flows;ntopng;password'";
      	}
      
      
      
      'mysql;mysql.server;ntopng;flows;ntopng;password'
      
      

      mysql - letting it know you are using a mysql db
      mysql.server - mysql server ip or hosename
      ntopng - mysql DB name, you have to create a DB so i used ntopng for its name
      flows - tablename prefix, it will create flowsv4 and flowsv6
      ntopng - mysql username that needs write access to the db it will be inserting data into
      password - password to the mysql user you are using to access you mysql server

      I also swapped the syntax order on line 139. I put the interfaces before the historical data option

      
      	$start .= "\t/usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -e {$disable_alerts} {$ifaces} {$dump_flows} {$dns_mode} {$aggregations} {$local_networks} &\n";
      
      

      Only LAN is keeping historical data. Not sure why but my other interfaces are vlans so that may have something to do with it.  Needs more testing to confirm.

      I noticed the 'Local Networks' option hasn't been updated to grab IPv6 addresses from interfaces. I manually updated line 117 to include my IPv6 subnet and also some of the multicast subnets to keep them local instead of remote within ntopng

      PS What happen to the preference menu item?

      1 Reply Last reply Reply Quote 0
      • dennypageD
        dennypage
        last edited by

        Version 0.8.4_1 with HTTPS support is rolling out now.

        1 Reply Last reply Reply Quote 0
        • MikeV7896M
          MikeV7896
          last edited by

          @dennypage:

          Version 0.8.4_1 with HTTPS support is rolling out now.

          Is this package update version 2.4 of ntopng, or still the previous version?

          The S in IOT stands for Security

          1 Reply Last reply Reply Quote 0
          • dennypageD
            dennypage
            last edited by

            It's the same version of ntopng, with the addition of support for HTTPS in the pfSense package.

            1 Reply Last reply Reply Quote 0
            • C
              Cino
              last edited by

              I found bug with the ssl version. You may want to remove "\n" from the new code.

              
              	if ($config['system']['webgui']['protocol'] == "https") {
              		$cert =& lookup_cert($config['system']['webgui']['ssl-certref']);
              		ntopng_write_cert_file("/usr/local/share/ntopng/httpdocs/ssl/ntopng-cert.pem", $cert);
              		$http_args = "-w 0 -W 3000\n";
              	} else {
              		unlink_if_exists("/usr/local/share/ntopng/httpdocs/ssl/ntopng-cert.pem");
              		$http_args = "-w 3000\n";
              	}
              
              

              It created the the startup file incorrectly

              
              rc_start() {
              		/usr/local/bin/redis-server --dir /var/db/ntopng/ --dbfilename ntopng.rdb &
              	/usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -s -e -w 0 -W 3000
                  -i 'em2' --dns-mode '0'  --local-networks 'fe80::/10,192.168.0.0/24,2000:0000:0000:2400::/64' &
              
              
              1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage
                last edited by

                @Cino:

                I found bug with the ssl version. You may want to remove "\n" from the new code.

                You are quite correct. Not sure how I missed that in testing.

                PR created.

                Thanks

                1 Reply Last reply Reply Quote 0
                • G
                  garyd9
                  last edited by

                  dennypage, is there some trick to getting someone to accept pull requests?  I submitted one a couple weeks ago to add ipv6 addresses to "local-networks" in the ntopng command line, but it's gone idle as far as I can see…

                  (I'm just trying to figure out if I missed a step in the submission or not.)

                  Thanks
                  Gary

                  1 Reply Last reply Reply Quote 0
                  • dennypageD
                    dennypage
                    last edited by

                    @garyd9:

                    dennypage, is there some trick to getting someone to accept pull requests?  I submitted one a couple weeks ago to add ipv6 addresses to "local-networks" in the ntopng command line, but it's gone idle as far as I can see…

                    No special trick, but I went to look for your PR and couldn't find it. What is the PR number?

                    1 Reply Last reply Reply Quote 0
                    • G
                      garyd9
                      last edited by

                      @dennypage:

                      No special trick, but I went to look for your PR and couldn't find it. What is the PR number?

                      https://github.com/pfsense/pfsense-packages/pull/1262

                      1 Reply Last reply Reply Quote 0
                      • dennypageD
                        dennypage
                        last edited by

                        I believe you want this repo here:

                        https://github.com/pfsense/FreeBSD-ports

                        which corresponds to packages in pfSense 2.3 and later.

                        Look in net/pfSense-pkg-ntopng.

                        1 Reply Last reply Reply Quote 0
                        • G
                          garyd9
                          last edited by

                          @dennypage:

                          I believe you want this repo here:

                          https://github.com/pfsense/FreeBSD-ports

                          which corresponds to packages in pfSense 2.3 and later.

                          Look in net/pfSense-pkg-ntopng.

                          Okay, thank you.  I'll redo my patch tomorrow morning in that other repo.

                          1 Reply Last reply Reply Quote 0
                          • R
                            r_e_d_b_a_r_o_n
                            last edited by

                            @dennypage:

                            @Cino:

                            I found bug with the ssl version. You may want to remove "\n" from the new code.

                            You are quite correct. Not sure how I missed that in testing.

                            PR created.

                            Thanks

                            Hello, I updated ntopng package to 0.8.4_2. From changelog it fixes problem with \n in startup script. BUT after upgrade still same config and startup file is generated. Edited it manually, removed newline but still not starting with error : "[HTTPserver.cpp:503] ERROR: Unable to start HTTP server (IPv4) on ports 3000s: Invalid argument". It only started after removing -W argument (HTTPS).
                            New bug or my problem?

                            Modified ntopng.sh

                            rc_start() {
                            /usr/local/bin/redis-server –dir /var/db/ntopng/ --dbfilename ntopng.rdb &
                            /usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -s -e -w 0 -W 3000    -i 'vmx1' -i 'vmx2' --dns-mode '0'  --local-networks '192.168.0.0/16,172.16.0.0/12,10.0.0.0/8' &

                            }

                            1 Reply Last reply Reply Quote 0
                            • dennypageD
                              dennypage
                              last edited by

                              If you are using HTTPS enabled in the pfSense gui, you will need to visit the ntopng settings page (Diagnostics / ntopng Settings) and press save. This will cause the certificate to be set up in order to use HTTPS with ntopng.

                              1 Reply Last reply Reply Quote 0
                              • luckman212L
                                luckman212 LAYER 8
                                last edited by

                                @dennypage:

                                It's the same version of ntopng, with the addition of support for HTTPS in the pfSense package.

                                Denny, do you know what the main reason is that the 2.4 version of ntopng isn't available in pfSense? I see the FreeBSD port has been ready for some time…
                                https://github.com/freebsd/freebsd-ports/blob/master/net/ntopng/Makefile

                                1 Reply Last reply Reply Quote 0
                                • kesawiK
                                  kesawi
                                  last edited by

                                  I've just upgraded to ntopng 0.8.4_2 on pfSense 2.3.2 and get the following error message in the System Log:

                                  ntopng 		[HTTPserver.cpp:503] ERROR: Unable to start HTTP server (IPv4) on ports 3000s: Invalid argument 
                                  

                                  The ntopng service is showing as stopped in the service status and the ntopng process isn't running (ie not appearing when I run ps aux or sockstat.

                                  I've tried uninstalling, reinstalling, and unchecking the "Keep Data/Settings" options, but my settings seem to be kept, and the error remains. I've tried changing the settings in the GUI and re-saving as suggested a couple of posts up.

                                  I do have a certificate (ntopng-cert.pem) in /usr/local/share/ntopng/httpdocs/ssl which gets regenerated each time I update the settings through the GUI.

                                  1 Reply Last reply Reply Quote 0
                                  • dennypageD
                                    dennypage
                                    last edited by

                                    Would you mind checking the sum on ntopng.inc please?

                                    The command is this: sum /usr/local/pkg/ntopng.inc

                                    The expected output is this: 51966 12 /usr/local/pkg/ntopng.inc

                                    Thanks

                                    1 Reply Last reply Reply Quote 0
                                    • dennypageD
                                      dennypage
                                      last edited by

                                      @luckman212:

                                      Denny, do you know what the main reason is that the 2.4 version of ntopng isn't available in pfSense?

                                      I don't have direct knowledge, but if I had to guess I would say that it's a fair bit of work and nobody has volunteered or been assigned for it.

                                      1 Reply Last reply Reply Quote 0
                                      • luckman212L
                                        luckman212 LAYER 8
                                        last edited by

                                        Hmm ok I didn't realize it was much work after the FreeBSD port.  Ok, I wish I could help somehow.  I looked at the "Developing Packages" page but tbh I wouldn't know where to start :(

                                        1 Reply Last reply Reply Quote 0
                                        • R
                                          r_e_d_b_a_r_o_n
                                          last edited by

                                          @dennypage:

                                          Would you mind checking the sum on ntopng.inc please?

                                          The command is this: sum /usr/local/pkg/ntopng.inc

                                          The expected output is this: 51966 12 /usr/local/pkg/ntopng.inc

                                          Thanks

                                          This is output of sum:

                                          51966 12 /usr/local/pkg/ntopng.inc

                                          As kesawi mention I also have certificate at place and it's regenerating.

                                          1 Reply Last reply Reply Quote 0
                                          • dennypageD
                                            dennypage
                                            last edited by

                                            Regeneration of the ssl certificate every time you save settings or reboot is expected.

                                            r_e_d_b_a_r_o_n, can you post the unmodified content of /usr/local/etc/rc.d/ntopng.sh please?

                                            And can you clarify the version of pfSense you are running as well?

                                            Thanks

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.