Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newdevice: Added additional support for Synology dsm #5136 #5145

Merged
merged 1 commit into from Dec 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions includes/discovery/os/dsm.inc.php
Expand Up @@ -7,6 +7,10 @@
'syno_dyn_module',
);

if (snmp_get($device, 'systemStatus.0', '-Osqnv', 'SYNOLOGY-SYSTEM-MIB', 'synology')) {
$os = 'dsm';
}

if (str_contains(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'), $init_params)) {
$os = 'dsm';
}
Expand Down
1 change: 1 addition & 0 deletions tests/OSDiscoveryTest.php
Expand Up @@ -455,6 +455,7 @@ public function testDsm()
{
$this->checkOS('dsm');
$this->checkOS('dsm', 'dsm-ds214');
$this->checkOS('dsm', 'dsm-ds916');
}

public function testEatonpdu()
Expand Down
3 changes: 3 additions & 0 deletions tests/mocks/mock.snmp.inc.php
Expand Up @@ -127,6 +127,9 @@ function snmp_translate_number($oid, $mib = null, $mibdir = null)
if ($oid == 'GAMATRONIC-MIB::psUnitManufacture.0') {
return '1.3.6.1.4.1.6050.1.1.2.0';
}
if ($oid === 'SYNOLOGY-SYSTEM-MIB::systemStatus.0') {
return '1.3.6.1.4.1.6574.1.1.0';
}
// end optimizations

if (preg_match('/^[\.\d]*$/', $oid)) {
Expand Down
4 changes: 4 additions & 0 deletions tests/snmpsim/dsm-ds916.snmprec
@@ -0,0 +1,4 @@
1.3.6.1.2.1.1.1.0|4|Linux Syno 3.10.77 #8451 SMP Wed Nov 9 13:45:59 CST 2016 x86_6
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10
1.3.6.1.2.1.25.1.4.0|4|root=/dev/md0 ihd_num=4 netif_num=2 HddHotplug=1 SataPortMap=23 sata_remap=0>2:1>3:2>0:3>1 acpi_enforce_resources=lax libata.for
1.3.6.1.4.1.6574.1.1.0|4|1