Project

General

Profile

Bug #3149 » smart_status.widget.diff

Adam Thompson, 08/16/2013 10:39 AM

View differences:

smart_status.widget.php 2013-08-16 10:40:43.000000000 -0500
47 47
if(count($devs) > 0)  {
48 48
	foreach($devs as $dev)  {	## for each found drive do
49 49
		$dev_ident = exec("diskinfo -v /dev/$dev | grep ident   | awk '{print $1}'"); ## get identifier from drive
50
		$dev_state = exec("smartctl -H /dev/$dev | grep result: | awk '{print $6}'"); ## get SMART state from drive
50
		$dev_state = exec("smartctl -H /dev/$dev | awk '/result/ {print $6}
51
/^SMART Health Status/ {print $4}'"); ## get SMART state from drive
51 52
		# Use light green color for passed, light coral otherwise.
52
		$color = ($dev_state == "PASSED") ? "#90EE90" : "#F08080";
53
		$color = ($dev_state == "PASSED" || $dev_state == "OK") ? "#90EE90" : "#F08080";
53 54
?>
54 55
		<tr>
55 56
			<td class="listlr"><?php echo $dev; ?></td>
(1-1/2)