From 5e2733492aaaa8a6c124d41e7f8d66d501f4915f Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 13 Aug 2014 12:58:46 -0400 Subject: More fixes for ntopng. Once the latest binaries are all in place it can be activated for testing. --- config/ntopng/ntopng.xml | 81 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 12 deletions(-) (limited to 'config/ntopng') diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index ef33373d..9d7544e5 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -53,7 +53,7 @@ ntopng Access ntopng
Diagnostics
- https://$myurl:3001 + http://$myurl:3000 ntopng @@ -65,12 +65,12 @@ ntopng Settings - /pkg_edit.php?xml=ntop.xml&id=0 + /pkg_edit.php?xml=ntopng.xml&id=0 Access ntopng - https://$myurl:3001 + http://$myurl:3000 @@ -93,6 +93,31 @@ lan true + + DNS Mode + dns_mode + Configures how name resolution is handled + select + 0 + + + + + + + + + Local Networks + local_networks + Configures how Local Networks are defined + select + rfc1918 + + + + + + = 0) && ($ntopng_config['dns_mode'] <= 3)) { + $dns_mode = "--dns-mode " . escapeshellarg($ntopng_config['dns_mode']); + } + + // Local Networks > + switch ($ntopng_config['local_networks']) { + case "selected": + $nets = array(); + foreach ($ntopng_config['interface_array'] as $iface) { + if (is_ipaddr(get_interface_ip($iface))) { + $nets[] = gen_subnet(get_interface_ip($iface),get_interface_subnet($iface)) . '/' . get_interface_subnet($iface); + } + } + if (!empty($nets)) + $local_networks = "--local-networks " . escapeshellarg(implode(",", $nets)); + break; + case "lanonly": + if (is_ipaddr(get_interface_ip('lan'))) { + $local_networks = "--local-networks " . escapeshellarg(gen_subnet(get_interface_ip('lan'),get_interface_subnet('lan')) . '/' . get_interface_subnet('lan')); + } + break; + case "rfc1918": + default: + $local_networks = "--local-networks '192.168.0.0/16,172.16.0.0/12,10.0.0.0/8'"; + break; + } + + $start = "ldconfig -m /usr/pbi/ntopng-i386/lib\n"; + $start .= "\t/usr/pbi/ntopng-" . php_uname("m") . "/bin/redis-server &\n"; // TODO: - // Add support for --dns-mode (0/1/2/3), --data-dir /somewhere, --httpdocs-dir /somewhereelse, - // --dump-timeline (on/off), --enable-aggregations (0/1/2), --local-networks, - // --http-port, --https-port - $start = "/usr/local/bin/ntopng -s -e {$ifaces} &"; + // Add support for --data-dir /somewhere, --httpdocs-dir /somewhereelse, + // --dump-timeline (on/off) --http-port, --https-port + + $start .= "\t/usr/local/bin/ntopng -s -e {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &"; write_rcfile(array( "file" => "ntopng.sh", "start" => $start, - "stop" => "/usr/bin/killall ntopng" + "stop" => "/usr/bin/killall ntopng redis-cli redis-server" ) ); if (is_service_running("ntopng")) { @@ -137,12 +193,13 @@ // Wait for ntopng to shut down cleanly. sleep(20); } + start_service("ntopng"); + sleep(2); + if (empty($ntopng_config['password'])) $ntopng_config['password'] = "admin"; $password = md5($ntopng_config['password']); - exec("/usr/local/bin/redis-cli SET user.admin.password " . escapeshellarg($password)); - sleep(2); - start_service("ntopng"); + mwexec_bg("/usr/pbi/ntopng-" . php_uname("m") . "/bin/redis-cli SET user.admin.password " . escapeshellarg($password)); conf_mount_ro(); config_unlock(); } -- cgit v1.2.3