Files
librenms-librenms/includes/polling/os/fs-switch.inc.php
Tony Murray 217969e140 Update php-codesniffer (#11368)
* PHPCS 3.5+

* Fix newly detected style issues
2020-04-03 08:41:24 -05:00

46 lines
1.1 KiB
PHP

<?php
if (!empty($matches[2])) {
$version .= " (" . trim($matches[2]) . ")";
}
// List of OIDs for HW recognition, add any potential HW OID here.
$hwOidList = [
'.1.3.6.1.4.1.27975.37.1.5.1.4.1.1',
'FS-MIB::swProdName.0',
];
foreach ($hwOidList as $oid) {
$hardware_tmp = snmp_get($device, $oid, '-OQv');
if (!empty($hardware_tmp)) {
$hardware = $hardware_tmp;
}
}
// List of OIDs for version, add any potential OID here.
// As the mib is really buggy, let's use numeric OID for now
$verOidList = [
'.1.3.6.1.4.1.27975.1.3.5.0', //SWITCH::version.0
'FS-MIB::swOpCodeVer.1',
];
foreach ($verOidList as $oid) {
$version_tmp = snmp_get($device, $oid, '-OQv');
if (!empty($version_tmp)) {
$version = $version_tmp;
break;
}
}
//List of OIDs for SN, add any potential device SN OID here
$snOidList = [
'.1.3.6.1.4.1.27975.37.1.5.1.10.1.1',
'.1.3.6.1.4.1.52642.2.1.45.1.1.3.1.10.1',
];
foreach ($snOidList as $oid) {
$serial_tmp = snmp_get($device, $oid, '-OQv');
if (!empty($serial_tmp)) {
$serial = $serial_tmp;
break;
}
}