From 950cf4e7a4d5bbc0a5a946340f65617e06faae4d Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 12 Mar 2010 02:35:38 +0000 Subject: [PATCH] hrdevice processors cleanup (strip vendor id, strip (TM) and (R)) git-svn-id: http://www.observium.org/svn/observer/trunk@1011 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/processors-hrdevice.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/discovery/processors-hrdevice.inc.php b/includes/discovery/processors-hrdevice.inc.php index c39395f54..2cc08c72c 100755 --- a/includes/discovery/processors-hrdevice.inc.php +++ b/includes/discovery/processors-hrdevice.inc.php @@ -17,6 +17,15 @@ $descr = $entry['hrDeviceDescr']; + $descr_array = explode(":",$entry['hrDeviceDescr']); + + if($descr_array['1']) { $descr = $descr_array['1']; } else { $descr = $descr_array['0']; } + + $descr = str_replace("CPU ", "", $descr); + $descr = str_replace("(TM)", "", $descr); + $descr = str_replace("(R)", "", $descr); + + $old_rrd = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("hrProcessor-" . $index . ".rrd"); $new_rrd = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("processor-hr-" . $index . ".rrd");