workaround bsnmp retardation and find some cpus (hardset type to processor if descr includes cpu)

git-svn-id: http://www.observium.org/svn/observer/trunk@2924 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-03-26 09:44:35 +00:00
parent 98ffa46ea0
commit 05110fc705
@@ -8,6 +8,11 @@ if (is_array($hrDevice_array))
{
foreach ($hrDevice_array as $index => $entry)
{
# Workaround bsnmpd reporting CPUs as hrDeviceOther (fuck you, FreeBSD.)
if ($entry['hrDeviceType'] == "hrDeviceOther" && preg_match('/^cpu[0-9]+:/', $entry['hrDeviceDescr']))
{
$entry['hrDeviceType'] = "hrDeviceProcessor";
}
if ($entry['hrDeviceType'] == "hrDeviceProcessor")
{
$hrDeviceIndex = $entry['hrDeviceIndex'];