mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Show model and serial on disk info page
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user