Skip to content

Commit

Permalink
Fixed missing FW and Serials in Dlink (#10481)
Browse files Browse the repository at this point in the history
* Fixed missing FW and Serials in Dlink
* Added .snmprec data
* Added jsons of test data
  • Loading branch information
hanserasmus authored and PipoCanaja committed Aug 2, 2019
1 parent c6e719b commit 1a54bdc
Show file tree
Hide file tree
Showing 23 changed files with 112,533 additions and 5 deletions.
32 changes: 27 additions & 5 deletions includes/polling/os/dlink.inc.php
Expand Up @@ -3,10 +3,32 @@
$Descr_string = $device['sysDescr'];
$Descr_chopper = preg_split('/[ ]+/', "$Descr_string");

$hardware = $Descr_chopper[0].' Rev. '.str_replace('"', '', snmp_get($device, '.1.3.6.1.4.1.171.12.11.1.9.4.1.12.1', '-Oqv'));
$version = snmp_get($device, '.1.3.6.1.4.1.171.12.11.1.9.4.1.11.1', '-Oqv');
$serial = snmp_get($device, '.1.3.6.1.4.1.171.12.11.1.9.4.1.17.1', '-Oqv');
$hardware = $Descr_chopper[0].' Rev. '.str_replace('"', '', snmp_get($device, '.1.3.6.1.2.1.16.19.3.0', '-Oqv'));

if (!$version) {
$version = snmp_get($device, 'dEntityExtVersionRuntime.1', '-Oqv', 'DLINKSW-ENTITY-EXT-MIB');
$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;
}
}
6,912 changes: 6,912 additions & 0 deletions tests/data/dlink_des-3526.json

Large diffs are not rendered by default.

6,681 changes: 6,681 additions & 0 deletions tests/data/dlink_des-3528.json

Large diffs are not rendered by default.

12,168 changes: 12,168 additions & 0 deletions tests/data/dlink_des-3550.json

Large diffs are not rendered by default.

7,620 changes: 7,620 additions & 0 deletions tests/data/dlink_dgs-1510-28x-me.json

Large diffs are not rendered by default.

7,428 changes: 7,428 additions & 0 deletions tests/data/dlink_dgs-1510-28xmp-me.json

Large diffs are not rendered by default.

6,681 changes: 6,681 additions & 0 deletions tests/data/dlink_dgs-3000-28x.json

Large diffs are not rendered by default.

7,380 changes: 7,380 additions & 0 deletions tests/data/dlink_dgs-3000-28xmp.json

Large diffs are not rendered by default.

6,556 changes: 6,556 additions & 0 deletions tests/data/dlink_dgs-3120-24tc.json

Large diffs are not rendered by default.

7,428 changes: 7,428 additions & 0 deletions tests/data/dlink_dgs-3420-28tc.json

Large diffs are not rendered by default.

9,617 changes: 9,617 additions & 0 deletions tests/data/dlink_dgs-3620-28sc.json

Large diffs are not rendered by default.

9,664 changes: 9,664 additions & 0 deletions tests/data/dlink_dgs-3627g.json

Large diffs are not rendered by default.

0 comments on commit 1a54bdc

Please sign in to comment.