ntopng
1.1 v0.1
Diagnostics: ntopng Settings
Change
pkg_edit.php?xml=ntopng.xml
ntopng
ntopng.sh
ntopng
ntopng bandwidth monitoring/graphing
ntopng Settings
/pkg_edit.php?xml=ntopng.xml&id=0
Access ntopng
http://$myurl:3000
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
DNS Mode
dns_mode
Configures how name resolution is handled
select
0
Local Networks
local_networks
Configures how Local Networks are defined
select
rfc1918
Historical Data Storage
dump_flows
Turn historical data storages on
checkbox
= 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;
}
// Historical Data Storage, Dump expired flows
if ($ntopng_config['dump_flows'] >= on) {
$dump_flows = "-F";
}
$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-" . php_uname("m") . "/lib\n";
$start .= "\t{$redis_path}/redis-server --dir /var/db/ntopng/ --dbfilename ntopng.rdb &\n";
// TODO:
// Add support for --data-dir /somewhere, --httpdocs-dir /somewhereelse,
// --dump-timeline (on/off) --http-port, --https-port
$start .= "\t/usr/local/bin/ntopng -d /var/db/ntopng -G /var/run/ntopng.pid -s -e {$dump_flows} {$ifaces} {$dns_mode} {$aggregations} {$local_networks} &";
write_rcfile(array(
"file" => "ntopng.sh",
"start" => $start,
"stop" => "/usr/bin/killall ntopng redis-cli redis-server"
)
);
if (is_service_running("ntopng")) {
stop_service("ntopng");
// 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']);
mwexec_bg("{$redis_path}/redis-cli SET user.admin.password " . escapeshellarg($password));
mwexec_bg("{$redis_path}/redis-cli save");
conf_mount_ro();
config_unlock();
}
]]>
sync_package_ntopng();
sync_package_ntopng();
exec("rm /usr/local/etc/rc.d/ntopng*");