improve junos cpu detection (from elec2)

git-svn-id: http://www.observium.org/svn/observer/trunk@2732 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-11-20 11:18:32 +00:00
parent c3113710a8
commit 7d85f5ff07

View File

@@ -6,6 +6,7 @@ if ($device['os'] == "junos")
echo("JUNOS : ");
$processors_array = snmpwalk_cache_multi_oid($device, "jnxOperatingCPU", $processors_array, "JUNIPER-MIB" , '+'.$config['install_dir']."/mibs/junos");
$processors_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $processors_array, "JUNIPER-MIB" , '+'.$config['install_dir']."/mibs/junos");
$processors_array = snmpwalk_cache_multi_oid($device, "jnxOperatingMemory", $processors_array, "JUNIPER-MIB" , '+'.$config['install_dir']."/mibs/junos");
$processors_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDescr", $processors_array, "JUNIPER-MIB" , '+'.$config['install_dir']."/mibs/junos");
if ($debug) { print_r($processors_array); }
@@ -13,8 +14,9 @@ if ($device['os'] == "junos")
{
foreach ($processors_array as $index => $entry)
{
if ($entry['jnxOperatingDescr'] == "Routing Engine" || $entry['jnxOperatingDescr'] == "Processor" || $entry['jnxOperatingDRAMSize'] && !strpos($entry['jnxOperatingDescr'], "sensor") && !strstr($entry['jnxOperatingDescr'], "fan"))
if ($entry['jnxOperatingDescr'] == "Routing Engine" || $entry['jnxOperatingDescr'] == "Processor" || $entry['jnxOperatingDRAMSize'] || $entry['jnxOperatingMemory'])
{
if (stripos($entry['jnxOperatingDescr'], "sensor") || stripos($entry['jnxOperatingDescr'], "fan")) continue;
if ($debug) { echo($index . " " . $entry['jnxOperatingDescr'] . " -> " . $entry['jnxOperatingCPU'] . " -> " . $entry['jnxOperatingDRAMSize'] . "\n"); }
$usage_oid = ".1.3.6.1.4.1.2636.3.1.13.1.8." . $index;
$descr = $entry['jnxOperatingDescr'];