$entry) { if (!is_numeric($entry['hrProcessorLoad'])) { continue; } if (!isset($entry['hrDeviceType'])) { $entry['hrDeviceType'] = 'hrDeviceProcessor'; $entry['hrDeviceIndex'] = $index; } elseif ($entry['hrDeviceType'] === 'hrDeviceOther' && preg_match('/^cpu\d+:/', $entry['hrDeviceDescr'])) { // Workaround bsnmpd reporting CPUs as hrDeviceOther (FY FreeBSD.) $entry['hrDeviceType'] = 'hrDeviceProcessor'; } if ($entry['hrDeviceType'] === 'hrDeviceProcessor') { $usage = $entry['hrProcessorLoad']; if ($device['os'] === 'arista_eos' && $index == 1) { continue; } if ($entry['hrDeviceDescr'] !== 'An electronic chip that makes the computer work.') { $hr_cpus++; $hr_total += $usage; } } unset($entry); } if ($hr_cpus) { $proc = $hr_total / $hr_cpus; } unset($hrDevice_oids, $hrDevice_array, $oid); } // EOF