mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Fix get_port_stats_by_port_hostname() to only return non-deleted ports #5131
This commit is contained in:
@ -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)
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user