aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/ntop2/ntop.xml151
-rwxr-xr-xpkg_config.8.xml4
-rwxr-xr-xpkg_config.8.xml.amd644
3 files changed, 155 insertions, 4 deletions
diff --git a/config/ntop2/ntop.xml b/config/ntop2/ntop.xml
new file mode 100644
index 00000000..0d420455
--- /dev/null
+++ b/config/ntop2/ntop.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ authng.xml
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2008 Scott Ullrich
+ All rights reserved. */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <name>ntop</name>
+ <version>3.0</version>
+ <title>Diagnostics: ntop Settings</title>
+ <savetext>Change</savetext>
+ <aftersaveredirect>pkg_edit.php?xml=ntop.xml&amp;id=0</aftersaveredirect>
+ <menu>
+ <name>ntop Settings</name>
+ <tooltiptext>Set ntop settings such as password and port.</tooltiptext>
+ <section>Diagnostics</section>
+ <url>/pkg_edit.php?xml=ntop.xml&amp;id=0</url>
+ </menu>
+ <menu>
+ <name>ntop</name>
+ <tooltiptext>Access ntop</tooltiptext>
+ <section>Diagnostics</section>
+ <url>http://$myurl:3000</url>
+ <depends_on_service>ntop</depends_on_service>
+ </menu>
+ <service>
+ <name>ntop</name>
+ <rcfile>ntop.sh</rcfile>
+ <executable>ntop</executable>
+ </service>
+ <tabs>
+ <tab>
+ <text>ntop Settings</text>
+ <url>/pkg_edit.php?xml=ntop.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Access ntop</text>
+ <url>http://$myurl:3000</url>
+ </tab>
+ </tabs>
+ <fields>
+ <field>
+ <fielddescr>ntop Admin Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Enter the password for the NTOP Web GUI. Minimum 5 characters.</description>
+ <type>password</type>
+ </field>
+ <field>
+ <fielddescr>ntop Admin Password AGAIN</fielddescr>
+ <fieldname>passwordagain</fieldname>
+ <type>password</type>
+ </field>
+ <field>
+ <fielddescr>Interface</fielddescr>
+ <fieldname>interface_array</fieldname>
+ <type>interfaces_selection</type>
+ <size>3</size>
+ <value>lan</value>
+ <multiple>true</multiple>
+ </field>
+ </fields>
+ <custom_php_global_functions>
+ function sync_package_ntop() {
+ conf_mount_rw();
+ config_lock();
+ global $config;
+ global $input_errors;
+ $ntop_config =&amp; $_POST;
+ $if_final = "";
+ $ifaces_final = "";
+ system("/bin/mkdir -p /var/db/ntop");
+ system("/bin/mkdir -p /var/db/ntop/rrd");
+ system("/bin/mkdir -p /var/db/ntop/rrd/graphics");
+ system("/bin/chmod -R 755 /var/db/ntop");
+ system("/usr/sbin/chown -R nobody:nobody /var/db/ntop");
+ if($ntop_config['password'] and $ntop_config['passwordagain']) {
+ if($ntop_config['password'] == $ntop_config['passwordagain']) {
+ $first = 0;
+ foreach($_POST['interface_array'] as $iface) {
+ $if = convert_friendly_interface_to_real_interface_name($iface);
+ if($if) {
+ if($first == 1)
+ $ifaces_final .= ",";
+ $ifaces_final .= $if;
+ $first = 1;
+ }
+ }
+ exec("/usr/local/bin/ntop --set-admin-password=" . $_POST['password'] . " &amp;", $ntopout);
+ $start = "/usr/local/bin/ntop -i " . $ifaces_final . " -u root -d --ipv4 -M -x 8102 -X 8192 &amp;";
+ write_rcfile(array(
+ "file" => "ntop.sh",
+ "start" => $start,
+ "stop" => "/usr/bin/killall ntop"
+ )
+ );
+ restart_service("ntop");
+ } else {
+ $input_errors[] = "The provided passwords did not match.";
+ }
+ } else {
+ $input_errors[] = "You must provide (and confirm) ntop's password.";
+ }
+ conf_mount_ro();
+ config_unlock();
+ }
+ </custom_php_global_functions>
+ <custom_add_php_command>
+ sync_package_ntop();
+ </custom_add_php_command>
+ <custom_php_resync_config_command>
+ sync_package_ntop();
+ </custom_php_resync_config_command>
+ <custom_php_install_command>
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ exec("rm /usr/local/etc/rc.d/ntop*");
+ </custom_php_deinstall_command>
+</packagegui> \ No newline at end of file
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index e75881c3..328c5d92 100755
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -168,10 +168,10 @@
<build_port_path>/usr/ports/x11-fonts/font-util</build_port_path>
<build_port_path>/usr/ports/net/ntop</build_port_path>
<build_options>WITHOUT_APNG=true WITHOUT_COLLATION_FIX=true WITHOUT_DEBUGGING=true WITHOUT_DEJAVU=true WITHOUT_DEVIL=true WITHOUT_DIGCOLA=true WITHOUT_EXTRA_PATCHES=true WITHOUT_FONTCONFIG=true WITHOUT_FPECTL=true WITHOUT_GAM_POLLER=true WITHOUT_GDBM=true WITHOUT_GDK_PIXBUF=true WITHOUT_GHOSTSCRIPT=true WITHOUT_GLITZ=true WITHOUT_GNOMEUI=true WITHOUT_GTK=true WITHOUT_GUILE=true WITHOUT_HUGE_STACK_SIZE=true WITHOUT_ICONV=true WITHOUT_IPSEPCOLA=true WITHOUT_LIBSIGSEGV=true WITHOUT_LOCALE=true WITHOUT_LUA=true WITHOUT_MING=true WITHOUT_MMAP=true WITHOUT_MULTIPLICITY=true WITHOUT_PANGOCAIRO=true WITHOUT_PCAP_PORT=true WITHOUT_PERL=true WITHOUT_PERL_MALLOC=true WITHOUT_PERL_MODULE=true WITHOUT_PHP=true WITHOUT_PTH=true WITHOUT_PYTHON=true WITHOUT_PYTHON_MODULE=true WITHOUT_RSVG=true WITHOUT_RUBY=true WITHOUT_RUBY_MODULE=true WITHOUT_SEM=true WITHOUT_SIMD=true WITHOUT_SITECUSTOMIZE=true WITHOUT_SMYRNA=true WITHOUT_SUIDPERL=true WITHOUT_TCL=true WITHOUT_THREADS=true WITHOUT_TK=true WITHOUT_X11=true WITHOUT_XCB=true WITHOUT_XMLDUMP=true WITHOUT_XPM=true WITHOUT_ZSH=true WITH_BASH=true WITH_EXTRA_ENCODINGS=true WITH_ICONV=true WITH_IPV6=true WITH_NLS=true WITH_PERL_64BITINT=true WITH_PYMALLOC=true WITH_TCPWRAPPER=true WITH_THREADS=true WITH_UCS4=true WITH_USE_PERL=true</build_options>
- <version>3.3.8</version>
+ <version>4.0.1_1</version>
<status>BETA</status>
<required_version>1.2.1</required_version>
- <config_file>http://www.pfsense.com/packages/config/ntop/ntop.xml</config_file>
+ <config_file>http://www.pfsense.com/packages/config/ntop2/ntop.xml</config_file>
<configurationfile>ntop.xml</configurationfile>
</package>
<package>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 499038cc..e1f51ec6 100755
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -219,10 +219,10 @@
<build_port_path>/usr/ports/x11-fonts/font-util</build_port_path>
<build_port_path>/usr/ports/net/ntop</build_port_path>
<build_options>WITHOUT_APNG=true WITHOUT_COLLATION_FIX=true WITHOUT_DEBUGGING=true WITHOUT_DEJAVU=true WITHOUT_DEVIL=true WITHOUT_DIGCOLA=true WITHOUT_EXTRA_PATCHES=true WITHOUT_FONTCONFIG=true WITHOUT_FPECTL=true WITHOUT_GAM_POLLER=true WITHOUT_GDBM=true WITHOUT_GDK_PIXBUF=true WITHOUT_GHOSTSCRIPT=true WITHOUT_GLITZ=true WITHOUT_GNOMEUI=true WITHOUT_GTK=true WITHOUT_GUILE=true WITHOUT_HUGE_STACK_SIZE=true WITHOUT_ICONV=true WITHOUT_IPSEPCOLA=true WITHOUT_LIBSIGSEGV=true WITHOUT_LOCALE=true WITHOUT_LUA=true WITHOUT_MING=true WITHOUT_MMAP=true WITHOUT_MULTIPLICITY=true WITHOUT_PANGOCAIRO=true WITHOUT_PCAP_PORT=true WITHOUT_PERL=true WITHOUT_PERL_MALLOC=true WITHOUT_PERL_MODULE=true WITHOUT_PHP=true WITHOUT_PTH=true WITHOUT_PYTHON=true WITHOUT_PYTHON_MODULE=true WITHOUT_RSVG=true WITHOUT_RUBY=true WITHOUT_RUBY_MODULE=true WITHOUT_SEM=true WITHOUT_SIMD=true WITHOUT_SITECUSTOMIZE=true WITHOUT_SMYRNA=true WITHOUT_SUIDPERL=true WITHOUT_TCL=true WITHOUT_THREADS=true WITHOUT_TK=true WITHOUT_X11=true WITHOUT_XCB=true WITHOUT_XMLDUMP=true WITHOUT_XPM=true WITHOUT_ZSH=true WITH_BASH=true WITH_EXTRA_ENCODINGS=true WITH_ICONV=true WITH_IPV6=true WITH_NLS=true WITH_PERL_64BITINT=true WITH_PYMALLOC=true WITH_TCPWRAPPER=true WITH_THREADS=true WITH_UCS4=true WITH_USE_PERL=true</build_options>
- <version>3.3.10</version>
+ <version>4.0.1_1</version>
<status>BETA</status>
<required_version>1.2.1</required_version>
- <config_file>http://www.pfsense.com/packages/config/ntop/ntop.xml</config_file>
+ <config_file>http://www.pfsense.com/packages/config/ntop2/ntop.xml</config_file>
<configurationfile>ntop.xml</configurationfile>
</package>
<package>