Files
librenms-librenms/includes/discovery/ports/moxa-etherdevice.inc.php
rhinoau 03482ddd65 Added Moxa switching ifAlias/portName mapping (#14633)
* WIP: Added Moxa switching ifAlias/portName mapping

* style fixes
2022-12-16 09:59:41 -06:00

23 lines
746 B
PHP

<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
* @author rhinoau
*/
//portName OID is based on each device model/MIB
$oid = $device['sysObjectID'] . '.1.9.1.1.7';
$port_names = snmpwalk_cache_oid($device, $oid, $port_names);
foreach ($port_names as $oid => $value) {
if (! empty($value['iso'])) {
// determine index
$index = end(explode('.', $oid));
$port_stats[$index]['ifAlias'] = $value['iso'];
}
}