| @@ 189-200 (lines=12) @@ | ||
| 186 | } |
|
| 187 | } else { |
|
| 188 | //SCSI devices |
|
| 189 | if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) { |
|
| 190 | preg_match('/read\: (.*)\n/', $result, $lines); |
|
| 191 | if (!empty($lines) && !empty($lines[0])) { |
|
| 192 | $values=preg_split('/\s+/', $lines[0]); |
|
| 193 | if (!empty($values) && ($values[7]!=null)) { |
|
| 194 | $vals=preg_split('/[,\.]/', $values[7]); |
|
| 195 | $this->_result[$disk][0]['id'] = 1; |
|
| 196 | $this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate"; |
|
| 197 | $this->_result[$disk][0]['raw_value'] = $vals[0]; |
|
| 198 | } |
|
| 199 | } |
|
| 200 | } |
|
| 201 | if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) { |
|
| 202 | preg_match('/Elements in grown defect list\: (.*)\n/', $result, $lines); |
|
| 203 | if (!empty($lines) && !empty($lines[0])) { |
|
| @@ 201-212 (lines=12) @@ | ||
| 198 | } |
|
| 199 | } |
|
| 200 | } |
|
| 201 | if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) { |
|
| 202 | preg_match('/Elements in grown defect list\: (.*)\n/', $result, $lines); |
|
| 203 | if (!empty($lines) && !empty($lines[0])) { |
|
| 204 | $values=preg_split('/\s+/', $lines[0]); |
|
| 205 | if (!empty($values) && ($values[5]!=null)) { |
|
| 206 | $vals=preg_split('/[,\.]/', $values[5]); |
|
| 207 | $this->_result[$disk][1]['id'] = 5; |
|
| 208 | $this->_result[$disk][1]['attribute_name'] = "Reallocated_Sector_Ct"; |
|
| 209 | $this->_result[$disk][1]['raw_value'] = $vals[0]; |
|
| 210 | } |
|
| 211 | } |
|
| 212 | } |
|
| 213 | if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) { |
|
| 214 | preg_match('/ number of hours powered up = (.*)\n/', $result, $lines); |
|
| 215 | if (!empty($lines) && !empty($lines[0])) { |
|
| @@ 213-224 (lines=12) @@ | ||
| 210 | } |
|
| 211 | } |
|
| 212 | } |
|
| 213 | if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) { |
|
| 214 | preg_match('/ number of hours powered up = (.*)\n/', $result, $lines); |
|
| 215 | if (!empty($lines) && !empty($lines[0])) { |
|
| 216 | $values=preg_split('/\s+/', $lines[0]); |
|
| 217 | if (!empty($values) && ($values[7]!=null)) { |
|
| 218 | $vals=preg_split('/[,\.]/', $values[7]); |
|
| 219 | $this->_result[$disk][2]['id'] = 9; |
|
| 220 | $this->_result[$disk][2]['attribute_name'] = "Power_On_Hours"; |
|
| 221 | $this->_result[$disk][2]['raw_value'] = $vals[0]; |
|
| 222 | } |
|
| 223 | } |
|
| 224 | } |
|
| 225 | if (!empty($this->_ids[194]) && ($this->_ids[194]=="raw_value")) { |
|
| 226 | preg_match('/Current Drive Temperature\: (.*)\n/', $result, $lines); |
|
| 227 | if (!empty($lines) && !empty($lines[0])) { |
|
| @@ 225-236 (lines=12) @@ | ||
| 222 | } |
|
| 223 | } |
|
| 224 | } |
|
| 225 | if (!empty($this->_ids[194]) && ($this->_ids[194]=="raw_value")) { |
|
| 226 | preg_match('/Current Drive Temperature\: (.*)\n/', $result, $lines); |
|
| 227 | if (!empty($lines) && !empty($lines[0])) { |
|
| 228 | $values=preg_split('/\s+/', $lines[0]); |
|
| 229 | if (!empty($values) && ($values[3]!=null)) { |
|
| 230 | $vals=preg_split('/[,\.]/', $values[3]); |
|
| 231 | $this->_result[$disk][3]['id'] = 194; |
|
| 232 | $this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius"; |
|
| 233 | $this->_result[$disk][3]['raw_value'] = $vals[0]; |
|
| 234 | } |
|
| 235 | } |
|
| 236 | } |
|
| 237 | } |
|
| 238 | } |
|
| 239 | //Usage test |
|