Setting Up RAID Monitoring di CentOS

Beberapa provider dedicated server memberikan kita opsi untuk menggunakan Software RAID dalam menggunakan dedicated server yang mereka tawarkan. Yang jadi masalah, sering juga dalam menggunakan dedicated server itu hanya RAID 1 saja yang disetup tapi tidak disediakan fitur monitoring kondisi disk yang sedang berjalan. RAID hanya berguna kalau kita tahu salah satu disk ada yang rusak, kalau tidak tahu ya percuma juga. Nah bagaimana cara setting supaya kondisi kesehatan harddisk termonitor sehingga kita bisa melakukan RAID dengan baik dan benar?

Berikut kami quote dari website ioflood:

Easy instructions for setting up mdadm / software raid email alerts for failed drives in Centos, Ubuntu, and Debian:

First off, start by editing the following file.

On Centos:

On Debian / Ubuntu:

Make sure the configuration file it has the following line in it. If it doesn’t, copy and paste it in there:

Also add to this file the email address you’d like to have receive notifications:

And then save the file and exit.

 

Next we run the process and make sure it runs without error.

If this works correctly, we will want to make sure that this command runs at boot time. Edit the following file:

And copy and paste the line near the end of the file:

WARNING: The last line in /etc/rc.local for Debian (and possibly Ubuntu installs) is “exit 0” so you need to make sure that the command above goes BEFORE that line otherwise it will never run.

 

Finally, if you’d like to test that emails are being sent properly, you can run the following command:

This will send you an email regarding the current status of your raid arrays. Be sure to whitelist these emails so that when a real raid alert comes in, your email provider doesn’t send it to your spam box!

Mengatasi Masalah Saat Testing

Setelah kami menjalankan langkah demi langkah setting madm di atas, saat kami mencoba menjalankan test, muncul peringatan sebagai berikut di server kami;

[[email protected] ~]# /sbin/mdadm –monitor –scan –test
mdadm: Only one autorebuild process allowed in scan mode, aborting

Ini dikarenakan hanya boleh ada satu process mdadm berjalan, jadi kita matikan dulu semua proses mdadm yg berjalan, dengan command killall mdadm. Setelah itu kita lakukan command untuk test di atas.

Referensi:

https://ioflood.com/blog/2015/04/21/setting-up-software-raid-mdadm-status-alert-emails-for-failed-drives-in-centos-ubuntu-and-debian/

http://www.linuxquestions.org/questions/linux-newbie-8/mdadm-email-notification-4175468772/