mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Added Model number detection to old 3Com SWitches * Added test data * Added better way to obtain data from Old 3Com StackSwitches * Removed debug prints * Added needed mibs * Removed mibs and changed to oid in script * Added Original 3com mibs from http://oidref.com/static/mibdepot/* * Create 3com_4200.json
19 lines
999 B
PHP
19 lines
999 B
PHP
<?php
|
|
if (strpos($device['sysDescr'], 'Software')) {
|
|
$hardware = str_replace("3Com ", '', substr($device['sysDescr'], 0, strpos($device['sysDescr'], 'Software')));
|
|
// Version is the last word in the sysDescr's first line
|
|
list($version) = explode("\n", substr($device['sysDescr'], (strpos($device['sysDescr'], 'Version') + 8)));
|
|
} else {
|
|
$hardware = str_replace("3Com ", '', $device['sysDescr']);
|
|
$version = '';
|
|
// Old Stack Units
|
|
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.43.10.27.4.1.')) {
|
|
$oids = ['stackUnitDesc.1', 'stackUnitPromVersion.1', 'stackUnitSWVersion.1', 'stackUnitSerialNumber.1','stackUnitCapabilities.1'];
|
|
$data = snmp_get_multi($device, $oids, ['-OQUs','--hexOutputLength=0'], 'A3COM0352-STACK-CONFIG');
|
|
$hardware .= ' ' . $data[1]['stackUnitDesc'];
|
|
$version = $data[1]['stackUnitSWVersion'];
|
|
$serial = $data[1]['stackUnitSerialNumber'];
|
|
$features = $data[1]['stackUnitCapabilities'];
|
|
}
|
|
}
|