mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
device: Updated moxa-etherdevice hardware/software/version detection
* Update moxa-etherdevice.inc.php Would rather rely on `sysObjectID` when getting the hardware/software information as the `sysDescr` may be changed through the web interface of the device. Use numeric OID-s only. * Update moxa-etherdevice.inc.php Converted separate `snmp_get` calls into a single `snmp_get_multi_oid` call. * Update moxa-etherdevice.inc.php Unset variables at the end. * Update moxa-etherdevice.inc.php Unset multiple variables at once. * Update moxa-etherdevice.inc.php
This commit is contained in:
@@ -10,12 +10,16 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$oids = array(
|
||||
'hardware' => $device['sysObjectID'].'.1.2.0',
|
||||
'version' => $device['sysObjectID'].'.1.4.0',
|
||||
'serial' => $device['sysObjectID'].'.1.78.0',
|
||||
);
|
||||
|
||||
$os_data = snmp_get_multi_oid($device, $oids);
|
||||
|
||||
// Moxa people enjoy creating MIBs for each model!
|
||||
if ($device['sysDescr'] == 'IKS-6726A-2GTXSFP-T') {
|
||||
$mibmod = 'MOXA-IKS6726A-MIB';
|
||||
} elseif ($device['sysDescr'] == 'EDS-G508E-T') {
|
||||
$mibmod = 'MOXA-EDSG508E-MIB';
|
||||
foreach ($oids as $var => $oid) {
|
||||
$$var = trim($os_data[$oid], '"');
|
||||
}
|
||||
$version = snmp_get($device, "firmwareVersion.0", "-OQvs", $mibmod);
|
||||
$hardware = $device['sysDescr'];
|
||||
|
||||
unset($oids, $os_data);
|
||||
|
||||
Reference in New Issue
Block a user