用DELL服务器的午饭们想必都应该知道在Windows环境下的"Server Administrator"通过这个工具可以很方便的查看出服务器当前硬件的工作情况。由于工作需我使用的很多DELL服务器均安装的Linux操作系统,cpu/内存倒还好说,可硬盘都是通过PERC 6/i SAS阵列控制器创建RAID组然后提供给Linux系统使用的。而平时日常维护工作都是通过ssh文本模式远程登录到服务器的,为了能够在硬盘挂了以后及时亡羊补牢从DELL网站上找到了一个不错的软件dell-onlinediags-linux,这个软件功能很强大本文仅仅使用它的存储设备检测功能,其他的功能大家可以详细研究一下帮助文档,在此就不一一列出了。
第一步,获取软件
在 ftp://ftp.us.dell.com/diags/ 找到dell-onlinediags-linux软件包,现在最新版本是2.17.0.44。已经可以支持RedHat6了。我是在Centos5.5 x86_64系统上测试的,可以使用RHEL5的rpm包。
第二步,解压安装(本例下载tar包到/tmp目录下)
cd /tmp
tar zxvf dell-onlinediags-linux-2.17.0.44.tar.gz
cd onliediags
rpm -ivh RHEL5/srvadmin-hapi-6.4.0-1.42.1.el5.i386.rpm
rpm -ivh x86_64/pediags-storelib-sysfs-6.4.0-1.2.1.el4.i386.rpm (如果是32bit系统安装RHEL5目录下的srvadmin-storelib-sysfs-6.4.0-1.4.2.el5.i386.rpm )
rpm -ivh dell-onlinediags-2.17.0-44.i386.rpm
第三步,检测查询
cd /opt/dell/onlinediags/oldiags/bin
./pediags sasdevdiag --run quicktest=true
The available device class(es) are:
可检测:
Command : Description
cddvd : Runs CDDVD diagnostics.
floppy : Runs Floppy diagnostics.
memory : Runs Memory diagnostics.
modem : Runs Modem diagnostics.
network : Runs Network diagnostics.
rac : Runs RAC diagnostics.
serialport : Runs Serial Port diagnostics.
raidctrl : Runs diagnostics for Dell SCSI RAID devices.
idedevdiag : Runs diagnostics for IDE and SATA devices.
sasdevdiag : Runs diagnostics for Dell SAS non-RAID and SAS RAID devices.
swraiddevdiag : Runs diagnostics for Dell SWRAID devices.
scsidevdiag : Runs diagnostics for Dell SCSI non-RAID devices.
usbctrl : Runs diagnostics for USB Root Hubs.
fcdevdiag : Runs diagnostics for Fibre Channel Devices.
然后屏幕会逐个出现一排小点.......耐心等待,这个要看磁盘多少了。我这里7块盘大概等了3分钟的样子吧。
然后会出现如下结果:
- ...................................................................
- Device Name : Dell PERC 6/i Integrated RAID Controller 1
- Description : Dell PERC 6/i Integrated RAID Controller 1
- Device Location : PCI Bus 3, Device 0, Function 0
- Test Name : SAS Controller Log Test
- Description : Gets the Controller Events Log.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:10 2011
- Completion Time : Tue Mar 15 13:48:10 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Dell PERC 6/i Integrated RAID Controller 1
- Description : Dell PERC 6/i Integrated RAID Controller 1
- Device Location : PCI Bus 3, Device 0, Function 0
- Test Name : Controller Self Test
- Description : Runs Self Diagnostics on the controller.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:52 2011
- Result Event : The test operation completed successfully. No errors found.
- Event String 1 : NVRAM test completed 37 passes successfully
- Event String 2 : Memory test completed 2 passes successfully
- Event String 3 : DISK test completed 11 passes successfully
- Event String 4 : XOR test completed 152 passes successfully
- Event String 5 : DMA test completed 18 passes successfully
- Event String 6 : Controller Battery Backup Unit Working Normally
- Device Name : Dell PERC 6/i Integrated RAID Controller 1
- Description : Dell PERC 6/i Integrated RAID Controller 1
- Device Location : PCI Bus 3, Device 0, Function 0
- Test Name : Controller TTY Log Test
- Description : Gets the Controller TTY Log.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:58 2011
- Completion Time : Tue Mar 15 13:49:58 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : SAS/SATA backplane 1:0
- Description : SAS/SATA backplane 1:0
- Device Location : Enclosure 1:0
- Test Name : SAS Phy Integrity Test
- Description : Gets Enclosure and HDD Phy Error Log Information.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:57 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:0
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 0
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:09 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:0
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 0
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:16 2011
- Completion Time : Tue Mar 15 13:49:46 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:1
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 1
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:09 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:1
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 1
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:16 2011
- Completion Time : Tue Mar 15 13:49:46 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:2
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 2
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:04 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:2
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 2
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:16 2011
- Completion Time : Tue Mar 15 13:49:46 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:3
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 3
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:05 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:3
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 3
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:06 2011
- Completion Time : Tue Mar 15 13:49:36 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : SAS/SATA backplane 1:0
- Description : SAS/SATA backplane 1:0
- Device Location : Enclosure 1:0
- Test Name : SAS Phy Integrity Test
- Description : Gets Enclosure and HDD Phy Error Log Information.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:50:00 2011
- Completion Time : Tue Mar 15 13:51:22 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:4
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 4
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:04 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:4
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 4
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:10 2011
- Completion Time : Tue Mar 15 13:49:40 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:5
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 5
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:06 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:5
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 5
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:12 2011
- Completion Time : Tue Mar 15 13:49:42 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:6
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 6
- Test Name : Disk Self Test
- Description : Tests the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:48:12 2011
- Completion Time : Tue Mar 15 13:49:04 2011
- Result Event : The test operation completed successfully. No errors found.
- Device Name : Array Disk 1:0:6
- Description : SAS TOSHIBA MBF2300RC
- Device Location : Slot 6
- Test Name : Disk Blink Test
- Description : Blinks the hard drive.
- Passes : 1
- Result : passed
- Start Time : Tue Mar 15 13:49:14 2011
- Completion Time : Tue Mar 15 13:49:44 2011
- Result Event : The test operation completed successfully. No errors found.
结果中有下划线标出的那部分就是第一块硬盘disk1:0:0的测试结果,看完全部结果很清楚的就能看出来Slot 0—Slot 6
一共7块硬盘每块盘测试两次,每次都是正常的。看到这样的结果心理终于踏实了,这样即便人没有在IDC机房托管服务器前,也一样可以知道服务器当前所有硬盘的工作状态了。写个脚本crontab每隔3天测试一次然后发封邮件给自己,这样是不是就再也不必担心硬盘挂了呢?
原文连接:http://bbs.51cto.com/thread-817166-1.html