[PATCH] Smart-Status module RHEL5


I noticed the smart-status module in Webmin 1.360 (likely earlier too) was correctly detecting smart support but not showing the smart status as enabled. I tracked it down to a slightly different output message from the smartctl version included in RHEL5/CentOS5. The attached patch [file name=smart_status_1.txt size=460]http://www.virtualmin.com/components/com_fireboard/uploaded/files/smart_status_1.txt[/file] adds another elseif section that detects the enabled smart correctly. Here’s some more info on the exact output from smartctl

First off, some versions on the server:
[evan@server ~]$ rpm -q smartmontools
[evan@server ~]$ rpm -q webmin
[evan@server ~]$ uname -a
Linux server 2.6.18-8.1.8.el5 #1 SMP Tue Jul 10 06:50:22 EDT 2007 i686 i686 i386 GNU/Linux
[evan@server ~]$ cat /etc/redhat-release
CentOS release 5 (Final)

This is the output from smartctl:
[root@server ~]# smartctl -i /dev/sda
smartctl version 5.36 [i686-redhat-linux-gnu] Copyright © 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Device: WDIGTL WDE18310 ULTRA2 Version: 1.30
Serial number: WM7091011367
Device type: disk
Local Time is: Wed Aug 22 02:29:36 2007 CST
Device supports SMART and is Enabled
Temperature Warning Disabled or Not Supported

You are currently only matching the following two outputs (which doesn’t cover the output above):
SMART support is: Enabled
Device is Enabled

Hope that helps<br><br>Post edited by: EvanWaite, at: 2007/08/22 11:07

Thanks for this patch - it will be included in the next release of Webmin.