Merge pull request #1431 from RaspAP/fix/vnstat-ifaces

Fix: add AP interface to vnstat for monitoring
This commit is contained in:
Bill Zimmerman 2023-10-23 13:33:04 +02:00 committed by GitHub
commit d75908ce40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,11 @@ function DisplayDashboard(&$extraFooterScripts)
$strTxBytes .= getHumanReadableDatasize($strTxBytes);
}
exec ('vnstat --dbiflist', $stdoutVnStatDB);
if (!preg_match('/'.$_SESSION['ap_interface'].'/', $stdoutVnStatDB[0])) {
exec('sudo vnstat --add --iface '.$_SESSION['ap_interface'], $return);
}
define('SSIDMAXLEN', 32);
// Warning iw comes with: "Do NOT screenscrape this tool, we don't consider its output stable."
exec('iw dev ' .$_SESSION['wifi_client_interface']. ' link ', $stdoutIw);

View File

@ -64,3 +64,4 @@ www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/wireguard/*.conf
www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/wireguard/wg-*.key
www-data ALL=(ALL) NOPASSWD:/usr/sbin/netplan
www-data ALL=(ALL) NOPASSWD:/bin/truncate -s 0 /tmp/*.log,/bin/truncate -s 0 /var/log/dnsmasq.log
www-data ALL=(ALL) NOPASSWD:/usr/bin/vnstat *