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:

nano /etc/mdadm.conf

On Debian / Ubuntu:

nano /etc/mdadm/mdadm.conf

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

DEVICE partitions

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

MAILADDR bill@ted.com

And then save the file and exit.

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

/sbin/mdadm --monitor --scan --daemonize

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

nano /etc/rc.local

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

/sbin/mdadm --monitor --scan --daemonize

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:

/sbin/mdadm --monitor --scan --test

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;

[root@s2 ~]# /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.

Mengecek Status SSD

This command lists the status of the SSD:

smartctl -ax /dev/sda
smartctl -ax /dev/sdb

This command performs a short test of the SSD:

smartctl -t short /dev/sda

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/


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *