mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
fix some rewriting of interfaces. fix some other small things.
git-svn-id: http://www.observium.org/svn/observer/trunk@757 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+11
-3
@@ -6,14 +6,22 @@ function formatMac($mac) {
|
||||
}
|
||||
|
||||
|
||||
function ifNameDescr ($interface, $device = NULL) {
|
||||
function ifNameDescr($interface, $device = NULL) {
|
||||
return ifLabel($interface, $device);
|
||||
}
|
||||
|
||||
function ifLabel ($interface, $device = NULL) {
|
||||
global $config;
|
||||
if(!$device) { $device = device_array($interface['device_id']); }
|
||||
$os = strtolower($device['os']);
|
||||
|
||||
if(isset($config['ifname'][$os])) {
|
||||
$interface['label'] = $interface['ifDescr'];
|
||||
} else {
|
||||
$interface['label'] = $interface['ifName'];
|
||||
} elseif(isset($config['ifAlias'][$os])) {
|
||||
$interface['label'] = $interface['ifAlias'];
|
||||
} else {
|
||||
$interface['label'] = $interface['ifDescr'];
|
||||
if(isset($config['appendifindex'][$os])) { $interface['label'] = $interface['label'] . " " . $interface['ifIndex']; }
|
||||
}
|
||||
return $interface;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user