From ec9321e5f6351f9181acae1a0ef37056110acab7 Mon Sep 17 00:00:00 2001 From: Ahmed Sajid Date: Thu, 4 Aug 2016 12:00:13 -0400 Subject: [PATCH 1/7] Powerconnect patches Added CPU polling for Dell Powerconnect 8024F device. Also added cpu and memory graphs to definitions file --- includes/definitions.inc.php | 4 ++++ .../discovery/processors/powerconnect.inc.php | 19 ++++++++++++++++--- .../polling/processors/powerconnect.inc.php | 17 ++++++++++++++--- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index a91168d3fe..72d2749956 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1025,6 +1025,10 @@ $config['os'][$os]['type'] = 'network'; $config['os'][$os]['icon'] = 'dell'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; $config['os'][$os]['over'][0]['text'] = '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'; $os = 'radlan'; $config['os'][$os]['text'] = 'Radlan'; diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index 770773a8b0..c37af767c2 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -1,8 +1,9 @@ Date: Thu, 4 Aug 2016 15:42:28 -0400 Subject: [PATCH 2/7] Updated Powerconnect CPU Change case statements to if else --- .../discovery/processors/powerconnect.inc.php | 26 ++++------------- .../polling/processors/powerconnect.inc.php | 29 ++++++------------- 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index c37af767c2..b633f07dde 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -2,33 +2,17 @@ if ($device['os'] == 'powerconnect') { $trimmed_sysObjectId = ltrim($device["sysObjectID"],"enterprise."); - switch ($trimmed_sysObjectId) { - case '674.10895.3031': - /* - * Devices supported: - * Dell Powerconnect 55xx - */ + if ($trimmed_sysObjectId == "674.10895.3031") { + echo "Dell Powerconnect 55xx"; $usage = trim(snmp_get($device, '.1.3.6.1.4.1.89.1.7.0', '-Ovq')); discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.89.1.7.0', '0', 'powerconnect', 'Processor', '1', $usage, null, null); - break; - - case '674.10895.3024': - /* - * Devices supported: - * Dell Powerconnect 8024F - */ + } elseif ($trimmed_sysObjectId == "674.10895.3024") { + echo "Dell Powerconnect 8024F"; $usage = trim(snmp_get($device,'.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '-Ovq'), '"'); $usage = ltrim($usage,' '); if (substr($usage, 0, 5) == '5 Sec') { discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '0', 'powerconnect', 'Processor', '1', $usage, null, null); - } - break; - - default: - /* - * Defaul Discovery for powerconnect series - * Dell-Vendor-MIB::dellLanExtension.6132.1.1.1.1.4.4.0 = STRING: "5 Sec (6.99%), 1 Min (6.72%), 5 Min (9.06%)" - */ + } else { $descr = 'Processor'; $usage = trim(snmp_get($device, 'dellLanExtension.6132.1.1.1.1.4.4.0', '-OQUvs', 'Dell-Vendor-MIB'), '"'); if (substr($usage, 0, 5) == '5 Sec') { diff --git a/includes/polling/processors/powerconnect.inc.php b/includes/polling/processors/powerconnect.inc.php index f3796e1927..bf5569af45 100644 --- a/includes/polling/processors/powerconnect.inc.php +++ b/includes/polling/processors/powerconnect.inc.php @@ -1,26 +1,15 @@ Date: Thu, 4 Aug 2016 15:47:46 -0400 Subject: [PATCH 3/7] Changed tab to 4 spaces --- includes/discovery/processors/powerconnect.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index b633f07dde..aa6e805968 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -12,7 +12,7 @@ if ($device['os'] == 'powerconnect') { $usage = ltrim($usage,' '); if (substr($usage, 0, 5) == '5 Sec') { discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '0', 'powerconnect', 'Processor', '1', $usage, null, null); - } else { + } else { $descr = 'Processor'; $usage = trim(snmp_get($device, 'dellLanExtension.6132.1.1.1.1.4.4.0', '-OQUvs', 'Dell-Vendor-MIB'), '"'); if (substr($usage, 0, 5) == '5 Sec') { @@ -20,3 +20,4 @@ if ($device['os'] == 'powerconnect') { } } } + From dfc6d212c2dc340f059593901b2f4bd5925689dc Mon Sep 17 00:00:00 2001 From: Ahmed Sajid Date: Thu, 4 Aug 2016 15:50:17 -0400 Subject: [PATCH 4/7] Changed tab to 4 spaces --- includes/discovery/processors/powerconnect.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index aa6e805968..055ba7df86 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -20,4 +20,3 @@ if ($device['os'] == 'powerconnect') { } } } - From 8f05fea263c1c4bdce092c6f10d8e4c37a6df617 Mon Sep 17 00:00:00 2001 From: Ahmed Sajid Date: Thu, 4 Aug 2016 16:20:13 -0400 Subject: [PATCH 5/7] Removed unnecessary trimming --- includes/discovery/processors/powerconnect.inc.php | 8 ++++---- includes/polling/processors/powerconnect.inc.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index 055ba7df86..dfaef2e3cf 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -1,18 +1,18 @@ Date: Fri, 5 Aug 2016 17:18:11 -0400 Subject: [PATCH 6/7] Update powerconnect.inc.php Changed echos to d_echos --- includes/discovery/processors/powerconnect.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index dfaef2e3cf..333a7af5d3 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -2,11 +2,11 @@ if ($device['os'] == 'powerconnect') { if (strpos($device["sysObjectID"], "enterprises.674.10895.3031") !== false) { - echo "Dell Powerconnect 55xx"; + d_echo "Dell Powerconnect 55xx"; $usage = trim(snmp_get($device, '.1.3.6.1.4.1.89.1.7.0', '-Ovq')); discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.89.1.7.0', '0', 'powerconnect', 'Processor', '1', $usage, null, null); } elseif (strpos($device["sysObjectID"], "enterprises.674.10895.3024") !== false) { - echo "Dell Powerconnect 8024F"; + d_echo "Dell Powerconnect 8024F"; $usage = trim(snmp_get($device,'.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '-Ovq'), '"'); $usage = ltrim($usage,' '); if (substr($usage, 0, 5) == '5 Sec') { From c678c10662423463c845e6ea508b7803c9c2a816 Mon Sep 17 00:00:00 2001 From: ahmedsajid Date: Fri, 5 Aug 2016 17:18:24 -0400 Subject: [PATCH 7/7] Update powerconnect.inc.php Changed echos to d_echos --- includes/polling/processors/powerconnect.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/polling/processors/powerconnect.inc.php b/includes/polling/processors/powerconnect.inc.php index f9bfe1ac9a..5e81efd1ee 100644 --- a/includes/polling/processors/powerconnect.inc.php +++ b/includes/polling/processors/powerconnect.inc.php @@ -1,10 +1,10 @@