newdevice: Added additional support for Synology DSM devices #2738

This commit is contained in:
Tony Murray
2016-10-15 09:49:07 -05:00
committed by Neil Lathwood
parent 980590b293
commit 521f3edd54
4 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
<?php
// Synology DSM
if (starts_with($sysDescr, 'Linux')) {
$init_params = array(
'syno_hw_version',
'syno_dyn_module',
);
if (str_contains(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'), $init_params)) {
$os = 'dsm';
}
}

View File

@@ -50,8 +50,6 @@ if (starts_with($sysDescr, 'Linux') && !starts_with($sysObjectId, $skip_oids)) {
$os = 'sophos';
} elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) {
$os = 'ddnos';
} elseif (str_contains(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'), 'syno_hw_version')) {
$os = 'dsm'; // Synology DSM
} elseif (is_numeric(trim(snmp_get($device, 'roomTemp.0', '-OqvU', 'CAREL-ug40cdz-MIB')))) {
$os = 'pcoweb'; // Carel PCOweb
}

View File

@@ -442,6 +442,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
public function testDsm()
{
$this->checkOS('dsm');
$this->checkOS('dsm', 'dsm-ds214');
}
public function testEatonpdu()

View File

@@ -0,0 +1,3 @@
1.3.6.1.2.1.1.1.0|4|Linux xxxxx 3.2.40 #7393 SMP PREEMPT Thu Jun 2 19:47:23 CST 2016 i686
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 HddHotplug=1 ihd_num=2 netif_num=1 syno_dyn_module=n phys_memsize=1024 memmap=exactmap memmap=128K@128K memmap=711