วันจันทร์ที่ 13 เมษายน พ.ศ. 2558

Monitor SMART status of HDD’s in CentOS

http://www.betweendots.com/topic/56-monitor-smart-status-of-hdd%E2%80%99s-in-centos/



yum install smartmontools
Find out what drive you have to monitor. One way you can do this is by checking what partitions are on what drive:
 
cat /proc/partitions
You’ll get a result like this:
 
major minor  #blocks  name

   8       16 1953514584 sdb
   8       17   16777216 sdb1
   8       18     524288 sdb2
   8       19 1936208984 sdb3
   8        0 1953514584 sda
   8        1   16777216 sda1
   8        2     524288 sda2
   8        3 1936208984 sda3
   9        2 1936208832 md2
   9        1     524224 md1
   9        0   16777088 md0
You can see we have sda and sdb devices, the "md" devices are software raid partitions. 

You can usually identify which hard disks are on your system also by looking in /proc/ide and in /proc/scsi.

If you want to do a quick test to see what the health of a device is you can do this by entering the following command:
smartctl -H /dev/sdb
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.11.2.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net


=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
If you want to be notified as soon as a devices fails SMART testing automatically, then you can run the smartd daemon:
service smartd start
chkconfig smartd on 

ไม่มีความคิดเห็น:

แสดงความคิดเห็น