From f73e4d29a38d7e2598e6d4619cabdd729652c464 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 13 Apr 2012 00:23:20 +0000 Subject: [PATCH] detect cpu and mempools via alternate mibs on some srx platforms, actually a juniper bug that the real mib isn't populated, but meh git-svn-id: http://www.observium.org/svn/observer/trunk@3032 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/mempools/junos.inc.php | 20 ++++++++++++++++++++ includes/discovery/processors/junos.inc.php | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/includes/discovery/mempools/junos.inc.php b/includes/discovery/mempools/junos.inc.php index 4cdd9e94db..a3a546caa4 100755 --- a/includes/discovery/mempools/junos.inc.php +++ b/includes/discovery/mempools/junos.inc.php @@ -28,8 +28,28 @@ if ($device['os'] == "junos") } ## End if checks } ## End Foreach } ## End if array + else + { + $srx_mempools_array = snmpwalk_cache_multi_oid($device, "jnxJsSPUMonitoringMemoryUsage", $srx_mempools_array, "JUNIPER-SRX5000-SPU-MONITORING-MIB" , '+'.$config['install_dir']."/mibs/junos"); + + if (is_array($srx_mempools_array)) + { + foreach ($srx_mempools_array as $index => $entry) + { + if ($index) + { + $usage_oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.5." . $index; + $descr = "Memory"; # No description in the table? + $usage = $entry['jnxJsSPUMonitoringMemoryUsage']; + + discover_mempool($valid_mempool, $device, $index, "junos", $descr, "1", NULL, NULL); + } + } + } + } } ## End JUNOS mempools unset ($mempools_array); +unset ($srx_mempools_array); ?> diff --git a/includes/discovery/processors/junos.inc.php b/includes/discovery/processors/junos.inc.php index 90b9ddd5f3..b42a7fa3d7 100755 --- a/includes/discovery/processors/junos.inc.php +++ b/includes/discovery/processors/junos.inc.php @@ -28,8 +28,28 @@ if ($device['os'] == "junos") } ## End if checks } ## End Foreach } ## End if array + else + { + $srx_processors_array = snmpwalk_cache_multi_oid($device, "jnxJsSPUMonitoringCPUUsage", $srx_processors_array, "JUNIPER-SRX5000-SPU-MONITORING-MIB" , '+'.$config['install_dir']."/mibs/junos"); + + if (is_array($srx_processors_array)) + { + foreach ($srx_processors_array as $index => $entry) + { + if ($index) + { + $usage_oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4." . $index; + $descr = "CPU"; # No description in the table? + $usage = $entry['jnxJsSPUMonitoringCPUUsage']; + + discover_processor($valid['processor'], $device, $usage_oid, $index, "junos", $descr, "1", $usage, NULL, NULL); + } + } + } + } } ## End JUNOS Processors unset ($processors_array); +unset ($srx_processors_array); ?>