diff --git a/CONTROL/control b/CONTROL/control
index 93187289..fbf07f0d 100644
--- a/CONTROL/control
+++ b/CONTROL/control
@@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
-Version: 1.2.4
+Version: 1.2.4-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.5),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7)
diff --git a/webif/html/diag/disk.jim b/webif/html/diag/disk.jim
index 36fcfe21..cf317133 100755
--- a/webif/html/diag/disk.jim
+++ b/webif/html/diag/disk.jim
@@ -53,10 +53,9 @@ puts {
Raw Value |
Value |
Worst |
- Thresh |
- Type |
- Updated |
- When Failed |
+ Threshold |
+ Life Left |
+ Notes |
}
@@ -92,6 +91,10 @@ proc flags {val} {
return "$f"
}
+set nolife {184 187 188 189 191 197 198}
+
+set derive {4 "" 5 sectors 9 hours 12 cycles 192 "" 193 "cycles"}
+
set i 0
foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
regsub -all -- {[[:space:]]+} $line " " line
@@ -107,7 +110,7 @@ foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
}
10 {
$settings _nval_setting "SMART_spinretry" $rval
- if {$rval > 0} { set class orangeshade }
+ #if {$rval > 0} { set class orangeshade }
}
197 {
$settings _nval_setting "SMART_pending" $rval
@@ -118,8 +121,32 @@ foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
if {$rval > 0} { set class redshade }
}
}
- puts ""
- puts "
+ if {$val <= $thresh} {
+ set class redshade
+ }
+ set left ""
+ if {$id ni $nolife &&
+ [expr $flags & 0x18] == 0x10 && $val == $worst && $val <= 100} {
+ # Event counter which is not a rate and has not regressed.
+ set notes ""
+ set left [expr 100 - 100 * (100 - $val) / (100 - $thresh)]
+ if {$left < 10} { set class orangeshade }
+ if {$rval > 0 && [dict exists $derive $id]} {
+ set total [expr \
+ round(($rval / (100 - $left) * 100) \
+ / 10000) * 10000 \
+ ]
+ set remain $($total - $rval)
+ set notes "$remain of approximately $total $derive($id)"
+ }
+ set left "$left%"
+ }
+ if {[string match "*Temperature_Cel*" $name]} {
+ append val " ([expr 100 - $val]°C)"
+ append worst " ([expr 100 - $worst]°C)"
+ append thresh " ([expr 100 - $thresh]°C)"
+ }
+ puts "
$id |
$name |
[flags $flags] |
@@ -127,8 +154,7 @@ foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
$val |
$worst |
$thresh |
- $type |
- $updated |
+ $left |
$when |
"
}
@@ -174,7 +200,6 @@ puts {
-