fix: Fix get_port_stats_by_port_hostname() to only return non-deleted ports #5131

This commit is contained in:
Dave Hope 2016-12-08 15:40:00 +00:00 committed by Neil Lathwood
parent f0fefcfe4f
commit a970a8ddd1
2 changed files with 2 additions and 1 deletions

View File

@ -79,6 +79,7 @@ LibreNMS contributors:
- D. Britz <github@wrind.de> (flatterlight)
- Tobias Herrmann <tobias@fiveninedigital.ch> (Mightea)
- Nicolas Guillaumin <nicolas+github@guillaumin.me> (nguillaumin)
- Dave Hope <dave@hope.mx> (davehope)
- Jurrian van Iersel <jurrian@vaniersel.net> (jviersel)
- Adam Winberg <adam.winberg@gmail.com> (wiad)
- Maximilian Wilhelm <max@rfc2324.org> (BarbarossaTM)

View File

@ -86,7 +86,7 @@ function get_port_stats_by_port_hostname()
$hostname = $router['hostname'];
$device_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
$ifName = urldecode($router['ifname']);
$port = dbFetchRow('SELECT * FROM `ports` WHERE `device_id`=? AND `ifName`=?', array($device_id, $ifName));
$port = dbFetchRow('SELECT * FROM `ports` WHERE `device_id`=? AND `ifName`=? AND `deleted` = 0', array($device_id, $ifName));
$in_rate = $port['ifInOctets_rate'] * 8;
$out_rate = $port['ifOutOctets_rate'] * 8;