Files
librenms-librenms/includes/polling/os/dlink.inc.php
T

35 lines
841 B
PHP
Raw Normal View History

2014-03-13 06:04:30 -07:00
<?php
$Descr_string = $device['sysDescr'];
2015-07-13 20:10:26 +02:00
$Descr_chopper = preg_split('/[ ]+/', "$Descr_string");
2014-03-13 06:04:30 -07:00
$hardware = $Descr_chopper[0].' Rev. '.str_replace('"', '', snmp_get($device, '.1.3.6.1.2.1.16.19.3.0', '-Oqv'));
$versionOIDList = [
'DLINKSW-ENTITY-EXT-MIB::dEntityExtVersionRuntime.1',
'.1.3.6.1.2.1.16.19.2.0',
'.1.3.6.1.4.1.171.12.11.1.9.4.1.11.1',
];
foreach ($versionOIDList as $oid) {
$version_tmp = snmp_get($device, $oid, '-Oqv');
if (!empty($version_tmp)) {
$version = $version_tmp;
break;
}
}
$serialOIDList = [
'.1.3.6.1.4.1.171.12.11.1.9.4.1.17.1',
'.1.3.6.1.4.1.171.12.1.1.12.0',
];
foreach ($serialOIDList as $oid) {
$serial_tmp = snmp_get($device, $oid, '-Oqv');
if (!empty($serial_tmp)) {
$serial = $serial_tmp;
break;
}
}