From 86c67c0e6ecc177227896d09176e02d7486732fd Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 12 Aug 2014 16:02:36 -0400 Subject: Add skeleton for ntopng, not active to install yet. --- config/ntopng/ntop.xml | 178 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 config/ntopng/ntop.xml (limited to 'config/ntopng') diff --git a/config/ntopng/ntop.xml b/config/ntopng/ntop.xml new file mode 100644 index 00000000..4db9e9c8 --- /dev/null +++ b/config/ntopng/ntop.xml @@ -0,0 +1,178 @@ + + + + + + + + ntop + 3.0 + Diagnostics: ntop Settings + Change + pkg_edit.php?xml=ntop.xml&id=0 + + ntop Settings + Set ntop settings such as password and port. +
Diagnostics
+ /pkg_edit.php?xml=ntop.xml&id=0 +
+ + ntop + Access ntop +
Diagnostics
+ http://$myurl:3000 + ntop +
+ + ntop + ntop.sh + ntop + NTOP bandwidth monitoring/graphing + + + + ntop Settings + /pkg_edit.php?xml=ntop.xml&id=0 + + + + Access ntop + http://$myurl:3000 + + + + + ntop Admin Password + password + Enter the password for the NTOP Web GUI. Minimum 5 characters. + password + + + ntop Admin Password AGAIN + passwordagain + password + + + Interface + interface_array + interfaces_selection + 3 + lan + true + + + Allow merging interfaces<br>(Def: Do not merge) + allowmerge + checkbox + + + + "ntop.sh", + "start" => $start, + "stop" => "/usr/bin/killall ntop" + ) + ); + if (is_service_running("ntop")) { + stop_service("ntop"); + // Wait for ntop to shut down cleanly. + sleep(20); + } + if (empty($ntop_config['password'])) + $ntop_config['password'] = "admin"; + unlink_if_exists("/var/db/ntop/ntop_pw.db"); + exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']}"); + sleep(2); + start_service("ntop"); + conf_mount_ro(); + config_unlock(); + } + ]]> + + + sync_package_ntop(); + + + sync_package_ntop(); + + + sync_package_ntop(); + + + exec("rm /usr/local/etc/rc.d/ntop*"); + + + + +
\ No newline at end of file -- cgit v1.2.3 From 959f67b23ea8f594cdcba150dd88e6b8aabb9251 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 12 Aug 2014 16:33:03 -0400 Subject: Some blind changes to correct for ntopng differences. --- config/ntopng/ntop.xml | 119 +++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 62 deletions(-) (limited to 'config/ntopng') diff --git a/config/ntopng/ntop.xml b/config/ntopng/ntop.xml index 4db9e9c8..20582c86 100644 --- a/config/ntopng/ntop.xml +++ b/config/ntopng/ntop.xml @@ -7,9 +7,9 @@ /* $Id$ */ /* ========================================================================== */ /* - authng.xml + ntopng.xml part of pfSense (http://www.pfSense.com) - Copyright (C) 2008 Scott Ullrich + Copyright (C) 2014 ESF, LLC All rights reserved. */ /* ========================================================================== */ @@ -38,50 +38,50 @@ /* ========================================================================== */ ]]> - ntop - 3.0 - Diagnostics: ntop Settings + ntopng + 1.1 v0.1 + Diagnostics: ntopng Settings Change - pkg_edit.php?xml=ntop.xml&id=0 + pkg_edit.php?xml=ntopng.xml - ntop Settings - Set ntop settings such as password and port. + ntopng Settings + Set ntopng settings such as password and port.
Diagnostics
- /pkg_edit.php?xml=ntop.xml&id=0 + /pkg_edit.php?xml=ntopng.xml&id=0
- ntop - Access ntop + ntopng + Access ntopng
Diagnostics
- http://$myurl:3000 - ntop + https://$myurl:3001 + ntopng
- ntop - ntop.sh - ntop - NTOP bandwidth monitoring/graphing + ntopng + ntopng.sh + ntopng + ntopng bandwidth monitoring/graphing - ntop Settings + ntopng Settings /pkg_edit.php?xml=ntop.xml&id=0 - Access ntop - http://$myurl:3000 + Access ntopng + https://$myurl:3001 - ntop Admin Password + ntopng Admin Password password - Enter the password for the NTOP Web GUI. Minimum 5 characters. + Enter the password for the ntopng GUI. Minimum 5 characters, defaults to admin. password - ntop Admin Password AGAIN + Confirm ntopng Admin Password passwordagain password @@ -93,83 +93,78 @@ lan true - - Allow merging interfaces<br>(Def: Do not merge) - allowmerge - checkbox - "ntop.sh", + "file" => "ntopng.sh", "start" => $start, - "stop" => "/usr/bin/killall ntop" + "stop" => "/usr/bin/killall ntopng" ) ); - if (is_service_running("ntop")) { - stop_service("ntop"); - // Wait for ntop to shut down cleanly. + if (is_service_running("ntopng")) { + stop_service("ntopng"); + // Wait for ntopng to shut down cleanly. sleep(20); } - if (empty($ntop_config['password'])) - $ntop_config['password'] = "admin"; - unlink_if_exists("/var/db/ntop/ntop_pw.db"); - exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']}"); + 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("ntop"); + start_service("ntopng"); conf_mount_ro(); config_unlock(); } ]]> - sync_package_ntop(); + sync_package_ntopng(); - sync_package_ntop(); + sync_package_ntopng(); - sync_package_ntop(); + sync_package_ntopng(); - exec("rm /usr/local/etc/rc.d/ntop*"); + exec("rm /usr/local/etc/rc.d/ntopng*"); Date: Tue, 12 Aug 2014 16:33:42 -0400 Subject: Fix filename --- config/ntopng/ntop.xml | 173 ----------------------------------------------- config/ntopng/ntopng.xml | 173 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 173 deletions(-) delete mode 100644 config/ntopng/ntop.xml create mode 100644 config/ntopng/ntopng.xml (limited to 'config/ntopng') diff --git a/config/ntopng/ntop.xml b/config/ntopng/ntop.xml deleted file mode 100644 index 20582c86..00000000 --- a/config/ntopng/ntop.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - ntopng - 1.1 v0.1 - Diagnostics: ntopng Settings - Change - pkg_edit.php?xml=ntopng.xml - - ntopng Settings - Set ntopng settings such as password and port. -
Diagnostics
- /pkg_edit.php?xml=ntopng.xml&id=0 -
- - ntopng - Access ntopng -
Diagnostics
- https://$myurl:3001 - ntopng -
- - ntopng - ntopng.sh - ntopng - ntopng bandwidth monitoring/graphing - - - - ntopng Settings - /pkg_edit.php?xml=ntop.xml&id=0 - - - - Access ntopng - https://$myurl:3001 - - - - - ntopng Admin Password - password - Enter the password for the ntopng GUI. Minimum 5 characters, defaults to admin. - password - - - Confirm ntopng Admin Password - passwordagain - password - - - Interface - interface_array - interfaces_selection - 3 - lan - true - - - - "ntopng.sh", - "start" => $start, - "stop" => "/usr/bin/killall ntopng" - ) - ); - if (is_service_running("ntopng")) { - stop_service("ntopng"); - // Wait for ntopng to shut down cleanly. - sleep(20); - } - 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"); - conf_mount_ro(); - config_unlock(); - } - ]]> - - - sync_package_ntopng(); - - - sync_package_ntopng(); - - - sync_package_ntopng(); - - - exec("rm /usr/local/etc/rc.d/ntopng*"); - - - - -
\ No newline at end of file diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml new file mode 100644 index 00000000..20582c86 --- /dev/null +++ b/config/ntopng/ntopng.xml @@ -0,0 +1,173 @@ + + + + + + + + ntopng + 1.1 v0.1 + Diagnostics: ntopng Settings + Change + pkg_edit.php?xml=ntopng.xml + + ntopng Settings + Set ntopng settings such as password and port. +
Diagnostics
+ /pkg_edit.php?xml=ntopng.xml&id=0 +
+ + ntopng + Access ntopng +
Diagnostics
+ https://$myurl:3001 + ntopng +
+ + ntopng + ntopng.sh + ntopng + ntopng bandwidth monitoring/graphing + + + + ntopng Settings + /pkg_edit.php?xml=ntop.xml&id=0 + + + + Access ntopng + https://$myurl:3001 + + + + + ntopng Admin Password + password + Enter the password for the ntopng GUI. Minimum 5 characters, defaults to admin. + password + + + Confirm ntopng Admin Password + passwordagain + password + + + Interface + interface_array + interfaces_selection + 3 + lan + true + + + + "ntopng.sh", + "start" => $start, + "stop" => "/usr/bin/killall ntopng" + ) + ); + if (is_service_running("ntopng")) { + stop_service("ntopng"); + // Wait for ntopng to shut down cleanly. + sleep(20); + } + 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"); + conf_mount_ro(); + config_unlock(); + } + ]]> + + + sync_package_ntopng(); + + + sync_package_ntopng(); + + + sync_package_ntopng(); + + + exec("rm /usr/local/etc/rc.d/ntopng*"); + + + + +
\ No newline at end of file -- cgit v1.2.3 From 41312d9fb1c91c02fd6ead5756f2b3a88f5b529b Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 13 Aug 2014 09:20:45 -0400 Subject: Misc refinements for ntopng --- config/ntopng/ntopng.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/ntopng') diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index 20582c86..ef33373d 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -155,7 +155,10 @@ sync_package_ntopng(); + exec("rm /usr/local/etc/rc.d/ntopng*"); -- cgit v1.2.3 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 From a87623c8301712663a431afa6578bcf596630dea Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 13 Aug 2014 13:03:34 -0400 Subject: Fix path to geoip update script --- config/ntopng/ntopng.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/ntopng') diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index 9d7544e5..2ba22dd7 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -213,7 +213,7 @@ -- cgit v1.2.3 From 906e342cd9726889caec52e529cdad12022ec5d6 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 15 Aug 2014 18:49:18 -0400 Subject: Fix redis path for 2.2 (ntopng) --- config/ntopng/ntopng.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'config/ntopng') diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index 2ba22dd7..5428d205 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -175,8 +175,15 @@ break; } + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version >= 2.2) { + $redis_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/bin"; + } else { + $redis_path = "/usr/pbi/ntopng-" . php_uname("m") . "/bin"; + } + $start = "ldconfig -m /usr/pbi/ntopng-i386/lib\n"; - $start .= "\t/usr/pbi/ntopng-" . php_uname("m") . "/bin/redis-server &\n"; + $start .= "\t{$redis_path}/redis-server &\n"; // TODO: // Add support for --data-dir /somewhere, --httpdocs-dir /somewhereelse, // --dump-timeline (on/off) --http-port, --https-port @@ -199,7 +206,7 @@ if (empty($ntopng_config['password'])) $ntopng_config['password'] = "admin"; $password = md5($ntopng_config['password']); - mwexec_bg("/usr/pbi/ntopng-" . php_uname("m") . "/bin/redis-cli SET user.admin.password " . escapeshellarg($password)); + mwexec_bg("{$redis_path}/redis-cli SET user.admin.password " . escapeshellarg($password)); conf_mount_ro(); config_unlock(); } -- cgit v1.2.3