refactor: Use ifName if ifDescr is blank

* Add if statement for ROS os when querying remote port id for LLDP map

* Apply ifDescr fix in ports polling instead.
This commit is contained in:
Lorenzo Zafra
2017-07-29 05:09:15 -06:00
committed by Neil Lathwood
parent 9a84a53a3f
commit f66d73de89

View File

@@ -525,7 +525,13 @@ foreach ($ports as $port) {
// FIXME use $q_bridge_mib[$this_port['ifIndex']] to see if it is a trunk (>1 array count)
echo 'VLAN == '.$this_port['ifVlan'];
// When devices do not provide ifAlias data, populate with ifDescr data if configured
// When devices do not provide ifDescr data, populate with ifName data if available
if ($this_port['ifDescr'] == '' || $this_port['ifDescr'] == null) {
$this_port['ifDescr'] = $this_port['ifName'];
d_echo('Using ifName as ifDescr');
}
// When devices do not provide ifAlias data, populate with ifDescr data if configured
if ($this_port['ifAlias'] == '' || $this_port['ifAlias'] == null) {
$this_port['ifAlias'] = $this_port['ifDescr'];
d_echo('Using ifDescr as ifAlias');