get_port_stats_by_port_hostname returns deleted port #5131

Closed
davehope opened this Issue Dec 7, 2016 · 1 comment

Projects

None yet

2 participants

@davehope
Contributor
davehope commented Dec 7, 2016 edited

DO NOT DELETE THIS INFORMATION.

Please read this information carefully.

GitHub issues is for feature requests or bugs, please do not post issues asking for help or how to do X, Y or Z.
You can use our irc channel ##librenms on freenode to ask questions or our community site.

  • Is your install up to date? Updating your install
    Please do not submit an issue if your install is not up to date within the last 24 hours or on a stable monthly release.
  • Please include all of the information between the ==================================== section of ./validate.php.
  • If you would like us to add a new device then please provide the information asked for here
  • Please provide as much detail as possible.
Component Version
LibreNMS 28e35ef
DB Schema 151
PHP 5.6.27-0+deb8u1
MySQL 10.0.28-MariaDB-0+deb8u1
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2.1

When using the get_port_stats_by_port_hostname through curl, a deleted port is returned rather than the active (non ignored,disabled,deleted) port.

curl -H 'X-Auth-Token: x' http://x/api/v0/devices/x/ports/ppp0 | grep _id

   "port_id": "171",
   "device_id": "14",

Checking the corresponding list of ports for the device via the web interface (http://monitoringHost/ports) and selected "deleted" shows 15 deleted ports with the same device/name.

I would expect the port that is not deleted to be returned rather than the port with the lowest port_id.

@laf laf added API Bug labels Dec 7, 2016
@davehope davehope added a commit to davehope/librenms that referenced this issue Dec 8, 2016
@davehope davehope Fix for #5131
Change to get_port_stats_by_port_hostname() to return only non-deleted
ports.

I agree to the conditions of the Contributor Agreement contained in
doc/General/Contributing.md.
704fa5f
@davehope
Contributor
davehope commented Dec 8, 2016

Closed by #5137

@davehope davehope closed this Dec 8, 2016
@VimCommando VimCommando added a commit to VimCommando/librenms that referenced this issue Jan 4, 2017
@davehope @VimCommando davehope + VimCommando fix: Fix get_port_stats_by_port_hostname() to only return non-deleted…
… ports #5131
13490ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment