diff options
-rw-r--r-- | config/ntopng/ntopng.xml | 173 | ||||
-rw-r--r-- | pkg_config.10.xml | 17 | ||||
-rw-r--r-- | pkg_config.8.xml | 18 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 18 |
4 files changed, 226 insertions, 0 deletions
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 @@ +<?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$ */ +/* ========================================================================== */ +/* + ntopng.xml + part of pfSense (http://www.pfSense.com) + Copyright (C) 2014 ESF, LLC + 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>ntopng</name> + <version>1.1 v0.1</version> + <title>Diagnostics: ntopng Settings</title> + <savetext>Change</savetext> + <aftersaveredirect>pkg_edit.php?xml=ntopng.xml</aftersaveredirect> + <menu> + <name>ntopng Settings</name> + <tooltiptext>Set ntopng settings such as password and port.</tooltiptext> + <section>Diagnostics</section> + <url>/pkg_edit.php?xml=ntopng.xml&id=0</url> + </menu> + <menu> + <name>ntopng</name> + <tooltiptext>Access ntopng</tooltiptext> + <section>Diagnostics</section> + <url>https://$myurl:3001</url> + <depends_on_service>ntopng</depends_on_service> + </menu> + <service> + <name>ntopng</name> + <rcfile>ntopng.sh</rcfile> + <executable>ntopng</executable> + <description>ntopng bandwidth monitoring/graphing</description> + </service> + <tabs> + <tab> + <text>ntopng Settings</text> + <url>/pkg_edit.php?xml=ntop.xml&id=0</url> + <active/> + </tab> + <tab> + <text>Access ntopng</text> + <url>https://$myurl:3001</url> + </tab> + </tabs> + <fields> + <field> + <fielddescr>ntopng Admin Password</fielddescr> + <fieldname>password</fieldname> + <description>Enter the password for the ntopng GUI. Minimum 5 characters, defaults to admin.</description> + <type>password</type> + </field> + <field> + <fielddescr>Confirm ntopng Admin Password</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> + <![CDATA[ + function sync_package_ntopng() { + conf_mount_rw(); + config_lock(); + global $config; + global $input_errors; + if ($_POST) { + $config['installedpackages']['ntopng']['config'] = array(); + $config['installedpackages']['ntopng']['config'][0] = $_POST; + } + $ntopng_config =& $config['installedpackages']['ntopng']['config'][0]; + $if_final = ""; + $ifaces_final = ""; + system("/bin/mkdir -p /var/db/ntopng"); + system("/bin/mkdir -p /var/db/ntopng/rrd"); + system("/bin/mkdir -p /var/db/ntopng/rrd/graphics"); + system("/bin/chmod -R 755 /var/db/ntopng"); + system("/usr/sbin/chown -R nobody:nobody /var/db/ntopng"); + system("/bin/cp -Rp /usr/local/lib/X11/fonts/webfonts/ /usr/local/lib/X11/fonts/TTF/"); + $first = 0; + foreach($ntopng_config['interface_array'] as $iface) { + $if = convert_friendly_interface_to_real_interface_name($iface); + if ($if) { + $ifaces .= " " . escapeshellarg("-i {$if}"); + } + } + // 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} &"; + write_rcfile(array( + "file" => "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(); + } + ]]> + </custom_php_global_functions> + <custom_add_php_command> + sync_package_ntopng(); + </custom_add_php_command> + <custom_php_resync_config_command> + sync_package_ntopng(); + </custom_php_resync_config_command> + <custom_php_install_command> + sync_package_ntopng(); + </custom_php_install_command> + <custom_php_deinstall_command> + exec("rm /usr/local/etc/rc.d/ntopng*"); + </custom_php_deinstall_command> + <custom_php_validation_command> + <![CDATA[ + if ($_POST) { + if (empty($_POST['password']) || empty($_POST['passwordagain'])) + $input_errors[] = "You must provide (and confirm) ntopng's password."; + if ($_POST['password'] != $_POST['passwordagain']) + $input_errors[] = "The provided passwords did not match."; + } + ]]> + </custom_php_validation_command> +</packagegui>
\ No newline at end of file diff --git a/pkg_config.10.xml b/pkg_config.10.xml index ed890f54..3088ce71 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -269,6 +269,23 @@ <noembedded>true</noembedded> </package> <package> + <name>ntopng</name> + <website>http://www.ntop.org/</website> + <descr>ntopng (replaces ntop) is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the network status on the user's terminal. In Web mode it acts as a Web server, creating an HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, an HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.</descr> + <category>Network Management</category> + <depends_on_package_pbi>ntopng-1.1_2-##ARCH##.pbi</depends_on_package_pbi> + <build_pbi> + <port>net/ntopng</port> + </build_pbi> + <version>1.1 v0.1</version> + <status>ALPHA</status> + <!-- Only here to build binaries, not used yet --> + <required_version>3.0</required_version> + <config_file>https://packages.pfsense.org/packages/config/ntopng/ntopng.xml</config_file> + <configurationfile>ntopng.xml</configurationfile> + <noembedded>true</noembedded> + </package> + <package> <name>Notes</name> <website/> <descr>Track things you want to note for this system.</descr> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 5df3e30c..7491156e 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -367,6 +367,24 @@ <noembedded>true</noembedded> </package> <package> + <name>ntopng</name> + <website>http://www.ntop.org/</website> + <descr>ntopng (replaces ntop) is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the network status on the user's terminal. In Web mode it acts as a Web server, creating an HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, an HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.</descr> + <category>Network Management</category> + <depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url> + <depends_on_package_pbi>ntopng-1.1_1-i386.pbi</depends_on_package_pbi> + <build_pbi> + <port>net/ntopng</port> + </build_pbi> + <version>1.1 v0.1</version> + <status>ALPHA</status> + <!-- Only here to build binaries, not used yet --> + <required_version>3.0</required_version> + <config_file>https://packages.pfsense.org/packages/config/ntopng/ntopng.xml</config_file> + <configurationfile>ntopng.xml</configurationfile> + <noembedded>true</noembedded> + </package> + <package> <name>FreeSWITCH</name> <website>http://www.freeswitch.org/</website> <descr>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. </descr> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 9ba99594..260cadcc 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -354,6 +354,24 @@ <noembedded>true</noembedded> </package> <package> + <name>ntopng</name> + <website>http://www.ntop.org/</website> + <descr>ntopng (replaces ntop) is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the network status on the user's terminal. In Web mode it acts as a Web server, creating an HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, an HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.</descr> + <category>Network Management</category> + <depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> + <depends_on_package_pbi>ntopng-1.1_1-i386.pbi</depends_on_package_pbi> + <build_pbi> + <port>net/ntopng</port> + </build_pbi> + <version>1.1 v0.1</version> + <status>ALPHA</status> + <!-- Only here to build binaries, not used yet --> + <required_version>3.0</required_version> + <config_file>https://packages.pfsense.org/packages/config/ntopng/ntopng.xml</config_file> + <configurationfile>ntopng.xml</configurationfile> + <noembedded>true</noembedded> + </package> + <package> <name>FreeSWITCH</name> <website>http://www.freeswitch.org/</website> <descr>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. </descr> |