Fix some issues with/introduced by port association mode configuration. #2923

merged 5 commits into from Feb 7, 2016


None yet

2 participants


No description provided.

BarbarossaTM added some commits Feb 3, 2016
@BarbarossaTM BarbarossaTM Allow ignoring unmapable interfaces in poller.
  When using the ifName or ifDescr as means to map discovered ports to
  known ports in the DB (think of port association mode) it's possible
  that we're facing the problem that the ifName or ifDescr polled from
  the device is unset or an empty string (like when querying some ubnt
  devices...). If this happends we have no way to map this port to any
  port found in the database. As reported this situation may occur for
  the time of one poll and might resolve automagically before the next
  poller run happens. Without this special case this would lead to new
  ports added to the database each time this situation occurs. To give
  the user the choice between »a lot of new ports« and »some poll runs
  are missed but ports stay stable« the 'ignore_unmapable_port' option
  has been added to configure this behaviour. To skip the port in this
  loop is sufficient as the next loop is looping only over ports found
  in the database and "maps back". As we did not add a new port to the
  DB here, there's no port to be mapped to.

  I'm using the in_array() check here, as I'm not sure if an "ifIndex"
  can be legally set to 0, which would yield True when checking if the
  value is empty().

Signed-off-by: Maximilian Wilhelm <>
@BarbarossaTM BarbarossaTM Fix port association for adsl, etherlike and poe port information.
  In 2c9df26 I broke the association of
  ports in the DB and ports just polled via SNMP for the adsl, etherlike
  and poe submodules and no one noticed. This fixes this issue. Sorry.

Signed-off-by: Maximilian Wilhelm <>
@BarbarossaTM BarbarossaTM Remove redundant code from port-{adsl,etherlike,poe} polling submodules.
  $this_port already gets defined within include/polling/
  so there's no need to redefine it again in each submodule.

Signed-off-by: Maximilian Wilhelm <>
@BarbarossaTM BarbarossaTM Fix detection of deleted interfaces for ifName/ifDescr port associati…
…on mode.

  The previous ifIndex based port mapping schema did detect deleted ports
  by checking ports in the DB against the ports currently polled via SNMP
  which breaks when using another port mapping schema. This commit fixes
  problem by checking known and found ports by their port_id.

Signed-off-by: Maximilian Wilhelm <>
@BarbarossaTM BarbarossaTM Add ability to map ports based on their ifAlias.
Signed-off-by: Maximilian Wilhelm <>
f0o commented Feb 7, 2016

Schema-Nr needs to be bump'ed :)

@f0o f0o merged commit 6ef1cf9 into librenms:master Feb 7, 2016

1 of 2 checks passed

Auto-Deploy Build finished. No test results found.
Scrutinizer 1 new issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment