Generalise mapping ifDescr to ifAlias

This allows both per OS enforcing of ifDescr = ifAlias as well as populating
when ifAlias = '' or NULL
This commit is contained in:
Gerben Meijer
2015-08-07 17:07:26 +02:00
parent 2dd8fe0553
commit 5467756328
2 changed files with 3 additions and 3 deletions

View File

@@ -325,9 +325,9 @@ foreach ($ports as $port) {
echo 'VLAN == '.$this_port['ifVlan'];
// When devices do not provide ifAlias data, populate with ifDescr data if configured
if (($this_port['ifAlias'] == '' || $this_port['ifAlias'] == NULL) && $config['os'][$device['os']]['ifalias_null'] == 1) {
if ($this_port['ifAlias'] == '' || $this_port['ifAlias'] == NULL) || ($config['os'][$device['os']]['descr_to_alias'] == 1) {
$this_port['ifAlias'] = $this_port['ifDescr'];
d_echo('Using ifDescr due to ifAlias being NULL');
d_echo('Using ifDescr as ifAlias');
}
// Update IF-MIB data