From 5e2ef216f9de975b3896c5d1b8ee057ffaf47d5c Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Thu, 9 Feb 2017 09:00:08 +0000 Subject: [PATCH] newdevice: Added further QNAP Turbo NAS detection #5229 (#5804) * newdevice: Added further QNAP Turbo NAS detection #5229 * reverted to us linux.inc.php for detection * removed last sysMfgName reference --- includes/discovery/os/linux.inc.php | 2 ++ tests/OSDiscoveryTest.php | 1 + tests/snmpsim/qnap-ts431.snmprec | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 tests/snmpsim/qnap-ts431.snmprec diff --git a/includes/discovery/os/linux.inc.php b/includes/discovery/os/linux.inc.php index 5722371258..3848973765 100644 --- a/includes/discovery/os/linux.inc.php +++ b/includes/discovery/os/linux.inc.php @@ -25,5 +25,7 @@ if (starts_with($sysDescr, 'Linux') || starts_with($sysObjectId, '.1.3.6.1.4.1.8 } elseif (starts_with($wrt, 'Tomato ')) { $os = 'tomato'; } + } elseif (preg_match('/^QNAP Systems/', snmp_get($device, "entPhysicalMfgName.1", "-Ovqn", "ENTITY-MIB"))) { + $os = 'qnap'; } } diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index 2a403d28c2..3ed7fc8432 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -1365,6 +1365,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase public function testQnap() { $this->checkOS('qnap'); + $this->checkOS('qnap', 'qnap-ts431'); } public function testQuanta() diff --git a/tests/snmpsim/qnap-ts431.snmprec b/tests/snmpsim/qnap-ts431.snmprec new file mode 100644 index 0000000000..dd5d61665e --- /dev/null +++ b/tests/snmpsim/qnap-ts431.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.1.0|4|Linux TS-X31 4.2.2 +1.3.6.1.2.1.47.1.1.1.1.12.1|4|QNAP Systems, Inc.