diff --git a/includes/discovery/processors/junos.inc.php b/includes/discovery/processors/junos.inc.php index d6fc75379..f07fad372 100644 --- a/includes/discovery/processors/junos.inc.php +++ b/includes/discovery/processors/junos.inc.php @@ -28,22 +28,20 @@ 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 ($debug) { print_r($processors_array); } + if (is_array($srx_processors_array)) { - $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) { - foreach ($srx_processors_array as $index => $entry) + if (isset($index) && $index >= 0) { - 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']; + $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); - } + discover_processor($valid['processor'], $device, $usage_oid, $index, "junos", $descr, "1", $usage, NULL, NULL); } } }