Show model and serial on disk info page

This commit is contained in:
Jamie Cameron
2012-07-14 22:48:03 -07:00
parent 456345dab5
commit c75ea62e66
3 changed files with 28 additions and 0 deletions

View File

@@ -96,6 +96,18 @@ if ($st->{'support'} && $st->{'enabled'}) {
$st->{'check'} ? $text{'yes'} :
"<font color=#ff0000>$text{'no'}</font>");
}
if ($st->{'family'}) {
print &ui_table_row($text{'index_family'}, $st->{'family'});
}
if ($st->{'model'}) {
print &ui_table_row($text{'index_model'}, $st->{'model'});
}
if ($st->{'serial'}) {
print &ui_table_row($text{'index_serial'}, $st->{'serial'});
}
if ($st->{'capacity'}) {
print &ui_table_row($text{'index_capacity'}, $st->{'capacity'});
}
print &ui_table_end();
# Show extra attributes

View File

@@ -21,6 +21,10 @@ index_ecount=$1 errors detected
index_attrs=Additional SMART attributes
index_raw=Full SMART status report
index_return=module index
index_family=Model family
index_model=Model name
index_serial=Serial number
index_capacity=Capacity
monitor_type=SMART Drive Check
monitor_drive=Drive to check

View File

@@ -305,6 +305,18 @@ if ($config{'attribs'}) {
open(OUT, "$config{'smartctl'} $extra_args -a $qd |");
while(<OUT>) {
s/\r|\n//g;
if (/Model\s+Family:\s+(.*)/i) {
$rv{'family'} = $1;
}
elsif (/Device\s+Model:\s+(.*)/i) {
$rv{'model'} = $1;
}
elsif (/Serial\s+Number:\s+(.*)/i) {
$rv{'serial'} = $1;
}
elsif (/User\s+Capacity:\s+(.*)/i) {
$rv{'capacity'} = $1;
}
if (/^\((\s*\d+)\)(.*)\s(0x\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/) {
# An old-style vendor attribute
$doneknown = 1;