From b1c2ea219462fa3556801009e93c3610da8d20e4 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 4 Apr 2017 02:02:43 +0100 Subject: [PATCH] newdevice: Added HPE iPDU detection (#6334) --- includes/definitions/hpe-ipdu.yaml | 9 +++++++++ includes/polling/os/hpe-ipdu.inc.php | 26 ++++++++++++++++++++++++++ tests/OSDiscoveryTest.php | 5 +++++ tests/snmpsim/hpe-ipdu.snmprec | 2 ++ 4 files changed, 42 insertions(+) create mode 100644 includes/definitions/hpe-ipdu.yaml create mode 100644 includes/polling/os/hpe-ipdu.inc.php create mode 100644 tests/snmpsim/hpe-ipdu.snmprec diff --git a/includes/definitions/hpe-ipdu.yaml b/includes/definitions/hpe-ipdu.yaml new file mode 100644 index 0000000000..66d0e106d7 --- /dev/null +++ b/includes/definitions/hpe-ipdu.yaml @@ -0,0 +1,9 @@ +os: hpe-ipdu +text: 'HPE iPDU' +type: power +icon: hpe +over: + - { graph: device_bits, text: Traffic } +discovery: + - sysObjectId: + - .1.3.6.1.4.1.232.165.5 diff --git a/includes/polling/os/hpe-ipdu.inc.php b/includes/polling/os/hpe-ipdu.inc.php new file mode 100644 index 0000000000..99a8c41199 --- /dev/null +++ b/includes/polling/os/hpe-ipdu.inc.php @@ -0,0 +1,26 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +list(,$version) = explode('firmware version', $poll_device['sysDescr']); diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index e823a1521f..52580e5f17 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -821,6 +821,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase $this->checkOS('hpe-ilo'); } + public function testHpeIpdu() + { + $this->checkOS('hpe-ipdu'); + } + public function testHpeMsl() { $this->checkOS('hpe-msl'); diff --git a/tests/snmpsim/hpe-ipdu.snmprec b/tests/snmpsim/hpe-ipdu.snmprec new file mode 100644 index 0000000000..e8c1a1a146 --- /dev/null +++ b/tests/snmpsim/hpe-ipdu.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.1.0|4|HP Intelligent Modular PDU , revision W-J, firmware version 2.0.22 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.232.165.5 \ No newline at end of file