lots of cleanups to various things

git-svn-id: http://www.observium.org/svn/observer/trunk@1463 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-23 13:42:28 +00:00
parent 97111b96e0
commit 9052296c13
11 changed files with 101 additions and 134 deletions
@@ -7,8 +7,8 @@ if($device['os_group'] == "unix" && $count == "0")
echo("UCD Old: ");
$system = snmp_get($device, "ssCpuSystem.0", "-OvQ", "UCD-SNMP-MIB");
$user = snmp_get($device, "ssCpuUser.0", "-OvQ", "UCD-SNMP-MIB");
$idle = snmp_get($device, "ssCpuIdle.0", "-OvQ", "UCD-SNMP-MIB");
$user = snmp_get($device, "ssCpuUser.0", "-OvQ", "UCD-SNMP-MIB");
$idle = snmp_get($device, "ssCpuIdle.0", "-OvQ", "UCD-SNMP-MIB");
$percent = $system + $user + $idle;
@@ -6,6 +6,7 @@ if ($device['os_group'] == "unix" || $device['os'] == "windows" || $device['os']
{
echo("hrDevice ");
$hrDevice_oids = array('hrDevice','hrProcessorLoad');
unset($hrDevice_array);
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmpwalk_cache_oid($device, $oid, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
foreach($hrDevice_array[$device['device_id']] as $index => $entry)
{
@@ -40,9 +41,13 @@ if ($device['os_group'] == "unix" || $device['os'] == "windows" || $device['os']
{
discover_processor($valid_processor, $device, $usage_oid, $index, "hr", $descr, "1", $usage, NULL, $hrDeviceIndex);
}
unset($old_rrd,$new_rrd,$descr,$entry,$usage_oid,$index,$usage,$hrDeviceIndex,$descr_array);
}
unset($entry);
}
unset($hrDevice_oids, $hrDevice_array, $oid);
}
## End hrDevice Processors
?>
+2 -2
View File
@@ -14,10 +14,10 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
{
$entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
if($entry['cpmCPUTotal5minRev']) {
if(isset($entry['cpmCPUTotal5minRev'])) {
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.8." . $index;
$usage = $entry['cpmCPUTotal5minRev'];
} elseif($entry['cpmCPUTotal5min']) {
} elseif(isset($entry['cpmCPUTotal5min'])) {
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5." . $index;
$usage = $entry['cpmCPUTotal5min'];
}