diff --git a/includes/polling/os/unix.inc.php b/includes/polling/os/unix.inc.php index ebeb8f3fc7..b80f94311e 100644 --- a/includes/polling/os/unix.inc.php +++ b/includes/polling/os/unix.inc.php @@ -51,9 +51,8 @@ if ($device['os'] == "linux" || $device['os'] == "endian") { if ($agent_data['dmi']['system-product-name']) { $hardware = ($agent_data['dmi']['system-manufacturer'] ? $agent_data['dmi']['system-manufacturer'] . ' ' : '') . $agent_data['dmi']['system-product-name']; - # Clean up "Dell Computer Corporation" and "Intel Corporation" - $hardware = str_replace(" Computer Corporation", "", $hardware); - $hardware = str_replace(" Corporation", "", $hardware); + # Clean up Generic hardware descriptions + $hardware = rewrite_generic_hardware($hardware); } if ($agent_data['dmi']['system-serial-number']) { diff --git a/includes/polling/os/vmware.inc.php b/includes/polling/os/vmware.inc.php index 03bfbfe922..2961f6b786 100644 --- a/includes/polling/os/vmware.inc.php +++ b/includes/polling/os/vmware.inc.php @@ -17,6 +17,9 @@ $features = 'build-'.$data[0]['vmwProdBuild']; $hardware = snmp_get($device, 'entPhysicalDescr.1', '-OsvQU', 'ENTITY-MIB'); $serial = snmp_get($device, 'entPhysicalSerialNum.1', '-OsvQU', 'ENTITY-MIB'); +# Clean up Generic hardware descriptions +$hardware = rewrite_generic_hardware($hardware); + /* * CONSOLE: Start the VMware discovery process. */ diff --git a/includes/rewrites.php b/includes/rewrites.php index 3f484d265e..d8f95d3ca0 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -969,6 +969,12 @@ $rewrite_hrDevice = array( ' ' => ' ', ); +$rewrite_GenericHW = array( + ' Computer Corporation' => '', + ' Corporation' => '', + ' Inc.' => '', +); + // Specific rewrite functions @@ -1053,6 +1059,11 @@ function rewrite_junos_hardware($hardware) return ($hardware); } +function rewrite_generic_hardware($hardware) +{ + global $rewrite_GenericHW; + return array_str_replace($rewrite_GenericHW, $hardware); +} function fixiftype($type) {