Diagnostics: NTop
ntop
3.0
true
yes
Change
NTop Settings
/pkg_edit.php?xml=ntop.xml
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
iface
3
true
lan
interfaces_selection
conf_mount_rw();
config_lock();
if($_POST['password'] == $_POST['passwordagain']) {
$interfaces = " -i ";
$ifaces=$_POST['iface'];
$isfirst = 0;
foreach($ifaces as $element=>$if)
{
if($isfirst == 1) $interfaces .= ",";
$interfaces .= convert_friendly_interface_to_real_interface_name($ifaces[$element]);
$isfirst = 1;
}
system("/usr/local/bin/ntop --set-admin-password=" . $_POST['password']);
system("killall ntop 2>/dev/null");
system("rm /usr/local/etc/rc.d/ntop.sh");
$fout = fopen("/usr/local/etc/rc.d/ntop.sh","w");
fwrite($fout, "#!/bin/sh\n\n");
fwrite($fout, "/usr/local/bin/ntop " . $interfaces . " -u root -d --ipv4 -M\n\n");
fclose($fout);
conf_mount_ro();
config_unlock();
system("chmod 555 /usr/local/etc/rc.d/ntop.sh");
system("killall ntop 2>/dev/null");
system("/usr/local/etc/rc.d/ntop.sh");
} else {
echo "Passwords do not match!";
exit;
}
mwexec("/usr/bin/killall ntop");
system("rm /usr/local/etc/rc.d/ntop.sh");
$fout = fopen("/usr/local/etc/rc.d/ntop.sh","w");
fwrite($fout, "#!/bin/sh\n\n");
fwrite($fout, "/usr/local/bin/ntop -u root -d --ipv4 -M\n\n");
fclose($fout);
system("chmod 555 /usr/local/etc/rc.d/ntop.sh");