diff --git a/includes/discovery/os/axiscam.inc.php b/includes/discovery/os/axiscam.inc.php index 2060365f89..ec33f4a151 100644 --- a/includes/discovery/os/axiscam.inc.php +++ b/includes/discovery/os/axiscam.inc.php @@ -1,11 +1,7 @@ + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +$data = explode('; ', $poll_device['sysDescr']); + +if (isset($data[1])) { + $hardware = $data[1]; +} + +if (isset($data[3])) { + $version = $data[3]; +} diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index 424675744e..7bcc4632e8 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -29,17 +29,6 @@ include 'tests/mocks/mock.snmp.inc.php'; class DiscoveryTest extends \PHPUnit_Framework_TestCase { - public function testAiros() - { - $this->checkOS('airos', 'Linux', '.1.3.6.1.4.1.10002.1'); - $this->checkOS('airos', 'Linux', '.1.3.6.1.4.1.41112.1.4'); - - $mockSnmp = array( - 'dot11manufacturerName.5' => 'Ubiquiti', - ); - $this->checkOS('airos', 'Linux', '', $mockSnmp); - } - /** * Set up variables and include os discovery * @@ -67,6 +56,17 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedOS, $os); } + public function testAiros() + { + $this->checkOS('airos', 'Linux', '.1.3.6.1.4.1.10002.1'); + $this->checkOS('airos', 'Linux', '.1.3.6.1.4.1.41112.1.4'); + + $mockSnmp = array( + 'dot11manufacturerName.5' => 'Ubiquiti', + ); + $this->checkOS('airos', 'Linux', '', $mockSnmp); + } + public function testAirosAf() { $mockSnmp = array( @@ -75,6 +75,12 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase $this->checkOS('airos-af', 'Linux', '.1.3.6.1.4.1.10002.1', $mockSnmp); } + public function testAxiscam() + { + $this->checkOS('axiscam', ' ; AXIS 221; Network Camera; 4.30; Nov 29 2005 11:18; 141; 1;'); + $this->checkOS('axiscam', ' ; AXIS M7011; Network Video Encoder; 5.75.1; Mar 04 2015 10:10; 1FC; 1;'); + } + public function testCiscosmblinux() { $this->checkOS('ciscosmblinux', 'Linux Cisco Small Business');