From a5e9988112bed2a9632ea907452dabfa7fa71fbb Mon Sep 17 00:00:00 2001 From: Rosiak Date: Fri, 16 Sep 2016 21:48:08 +0200 Subject: [PATCH 1/3] newdevice: Added support for Cisco Callmanager --- includes/definitions.inc.php | 11 +++++++++++ includes/discovery/os/callmanager.inc.php | 17 +++++++++++++++++ includes/discovery/os/linux.inc.php | 1 + includes/polling/os/callmanager.inc.php | 13 +++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 includes/discovery/os/callmanager.inc.php create mode 100644 includes/polling/os/callmanager.inc.php diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 012c6ce003..9c007d6f05 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -692,6 +692,17 @@ $config['os'][$os]['over'][1]['text'] = 'CPU Usage'; $config['os'][$os]['over'][2]['graph'] = 'device_mempool'; $config['os'][$os]['over'][2]['text'] = 'Memory Usage'; +$os = 'callmanager'; +$config['os'][$os]['text'] = 'Cisco Unified Communications Manager'; +$config['os'][$os]['type'] = 'tele'; +$config['os'][$os]['icon'] = 'cisco'; +$config['os'][$os]['over'][0]['graph'] = 'device_bits'; +$config['os'][$os]['over'][0]['text'] = 'Device Traffic'; +$config['os'][$os]['over'][1]['graph'] = 'device_processor'; +$config['os'][$os]['over'][1]['text'] = 'CPU Usage'; +$config['os'][$os]['over'][2]['graph'] = 'device_mempool'; +$config['os'][$os]['over'][2]['text'] = 'Memory Usage'; + // Brocade NOS $os = 'nos'; $config['os'][$os]['text'] = 'Brocade NOS'; diff --git a/includes/discovery/os/callmanager.inc.php b/includes/discovery/os/callmanager.inc.php new file mode 100644 index 0000000000..b15264da22 --- /dev/null +++ b/includes/discovery/os/callmanager.inc.php @@ -0,0 +1,17 @@ + + * 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. + */ + +if (!$os) { + if (starts_with($sysObjectId, '.1.3.6.1.4.1.9.1.1348')) { + $os = 'callmanager'; + } +} diff --git a/includes/discovery/os/linux.inc.php b/includes/discovery/os/linux.inc.php index 4a1936d148..3b81e06001 100644 --- a/includes/discovery/os/linux.inc.php +++ b/includes/discovery/os/linux.inc.php @@ -7,6 +7,7 @@ if (!$os) { '.1.3.6.1.4.1.17713.21', '.1.3.6.1.4.1.2.3.51.3', '.1.3.6.1.4.1.7779.', // nios + '.1.3.6.1.4.1.9.1.1348' // Cisco Unified Communications Manager ); if (starts_with($sysDescr, 'Linux') && !starts_with($sysObjectId, $skip_oids)) { diff --git a/includes/polling/os/callmanager.inc.php b/includes/polling/os/callmanager.inc.php new file mode 100644 index 0000000000..15f30e008c --- /dev/null +++ b/includes/polling/os/callmanager.inc.php @@ -0,0 +1,13 @@ + + * 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. + */ + +$hardware = snmp_get($device, 'sysObjectID.0', '-Osqv', 'SNMPv2-MIB:CISCO-PRODUCTS-MIB'); From 256c1087df4f87ee6302a9ae789e8f3dc14cf5ac Mon Sep 17 00:00:00 2001 From: Rosiak Date: Fri, 16 Sep 2016 23:02:55 +0200 Subject: [PATCH 2/3] smal change --- includes/definitions.inc.php | 2 +- includes/discovery/os/{callmanager.inc.php => cucm.inc.php} | 2 +- includes/polling/os/{callmanager.inc.php => cucm.inc.php} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename includes/discovery/os/{callmanager.inc.php => cucm.inc.php} (94%) rename includes/polling/os/{callmanager.inc.php => cucm.inc.php} (100%) diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 9c007d6f05..bbadf1b993 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -692,7 +692,7 @@ $config['os'][$os]['over'][1]['text'] = 'CPU Usage'; $config['os'][$os]['over'][2]['graph'] = 'device_mempool'; $config['os'][$os]['over'][2]['text'] = 'Memory Usage'; -$os = 'callmanager'; +$os = 'cucm'; $config['os'][$os]['text'] = 'Cisco Unified Communications Manager'; $config['os'][$os]['type'] = 'tele'; $config['os'][$os]['icon'] = 'cisco'; diff --git a/includes/discovery/os/callmanager.inc.php b/includes/discovery/os/cucm.inc.php similarity index 94% rename from includes/discovery/os/callmanager.inc.php rename to includes/discovery/os/cucm.inc.php index b15264da22..ce8ffcf12a 100644 --- a/includes/discovery/os/callmanager.inc.php +++ b/includes/discovery/os/cucm.inc.php @@ -12,6 +12,6 @@ if (!$os) { if (starts_with($sysObjectId, '.1.3.6.1.4.1.9.1.1348')) { - $os = 'callmanager'; + $os = 'cucm'; } } diff --git a/includes/polling/os/callmanager.inc.php b/includes/polling/os/cucm.inc.php similarity index 100% rename from includes/polling/os/callmanager.inc.php rename to includes/polling/os/cucm.inc.php From fa330cf333fb7df74805b430f31f4d9c1b9ac5d2 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sun, 18 Sep 2016 19:11:10 +0100 Subject: [PATCH 3/3] Added Callmanager test --- tests/OSDiscoveryTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index fa7670a93d..0368de8000 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -94,6 +94,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase $this->checkOS('ciscosmblinux', 'Linux Cisco Small Business'); } + public function testCucm() + { + $this->checkOS('cucm', 'Something that we do not have', '.1.3.6.1.4.1.9.1.1348'); + } + public function testCumulus() { $this->checkOS('cumulus', 'Linux', '.1.3.6.1.4.1.40310');