mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
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:
@@ -404,7 +404,7 @@ $os = 'nos';
|
|||||||
$config['os'][$os]['text'] = 'Brocade NOS';
|
$config['os'][$os]['text'] = 'Brocade NOS';
|
||||||
$config['os'][$os]['type'] = 'network';
|
$config['os'][$os]['type'] = 'network';
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['ifalias_null'] = 1;
|
$config['os'][$os]['descr_to_alias'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||||
|
|||||||
@@ -325,9 +325,9 @@ foreach ($ports as $port) {
|
|||||||
echo 'VLAN == '.$this_port['ifVlan'];
|
echo 'VLAN == '.$this_port['ifVlan'];
|
||||||
|
|
||||||
// When devices do not provide ifAlias data, populate with ifDescr data if configured
|
// 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'];
|
$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
|
// Update IF-MIB data
|
||||||
|
|||||||
Reference in New Issue
Block a user