diff options
author | jim-p <jimp@pfsense.org> | 2013-08-20 13:49:17 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-08-20 15:41:17 -0400 |
commit | eb0287e96f01ea0880d3ccce762d6880b2b44792 (patch) | |
tree | 51e5cd9013063ac2ae7430b3ad4aa7575b9a4329 /usr | |
parent | d318da67a09a46282d5a95a6606088965dd39fc0 (diff) | |
download | pfsense-eb0287e96f01ea0880d3ccce762d6880b2b44792.zip pfsense-eb0287e96f01ea0880d3ccce762d6880b2b44792.tar.gz |
Add patch from the ticket to fix #3149
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/widgets/widgets/smart_status.widget.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/usr/local/www/widgets/widgets/smart_status.widget.php b/usr/local/www/widgets/widgets/smart_status.widget.php index 669a9c0..a4a9f5b 100644 --- a/usr/local/www/widgets/widgets/smart_status.widget.php +++ b/usr/local/www/widgets/widgets/smart_status.widget.php @@ -47,9 +47,21 @@ exec("ls /dev | grep '^\(ad\|da\|ada\)[0-9]\{1,2\}$'", $devs); ## From SMART sta if(count($devs) > 0) { foreach($devs as $dev) { ## for each found drive do $dev_ident = exec("diskinfo -v /dev/$dev | grep ident | awk '{print $1}'"); ## get identifier from drive - $dev_state = exec("smartctl -H /dev/$dev | grep result: | awk '{print $6}'"); ## get SMART state from drive - # Use light green color for passed, light coral otherwise. - $color = ($dev_state == "PASSED") ? "#90EE90" : "#F08080"; + $dev_state = trim(exec("smartctl -H /dev/$dev | awk -F: '/^SMART overall-health self-assessment test result/ {print $2;exit} +/^SMART Health Status/ {print $2;exit}'")); ## get SMART state from drive + switch ($dev_state) { + case "PASSED": + case "OK": + $color = "#90EE90"; + break; + case "": + $dev_state = "Unknown"; + $color = "#C0B788"; + break; + default: + $color = "#F08080"; + break; + } ?> <tr> <td class="listlr"><?php echo $dev; ?></td> |