The Zare Manager providers multiple tools to help run and maintain your servers. One of these tools if mdadm RAID health monitoring. By enabling this tool, your mdadm array will be continuously scanned incase of degraded performance or if a drive were to fail. An email message is then sent by your server and imported into the Zare Manager, so that yourself and Zare staff can see the issue and arrange to rectify it. You will also receive a notification to your email address.
Firstly you need to check if you have a mdadm array setup. If you server is running RAID with more than 1 disk, then its very likely you have. Please issue the following command to verify and the output will be similar to below.
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sda5 sdb5
463474688 blocks super 1.2 [2/2] [UU]
bitmap: 0/4 pages [0KB], 65536KB chunk
md0 : active raid1 sda2 sdb2
1047488 blocks super 1.0 [2/2] [UU]
bitmap: 0/1 pages [0KB], 65536KB chunk
In this case, md1 is the main/largest RAID device and has both disks attached, so we want to monitor this. (feel free to monitor multiple mdX). You must then run the pre-generated command within the manager to complete setup. You can find this by going to Dedicated->Your Server->Tools->RAID Monitoring, it will look similar to below.
mdadm --monitor --daemonise [email protected] --delay=1800 /dev/md1
If you wish to monitor a different RAID device than /dev/md1, you can simply change the number.
How to maintain monitoring after reboot/shutdown
In the event that your server reboots or is powered down, the above monitoring will stop and ordinarily you would then need to issue the command again. This is not ideal, so the below command will ensure that the monitoring command is issued automatically on boot. It will look similar to below, however you must copy the whole command from the manager, like in the above section.
echo -e "mdadm --monitor --daemonise [email protected] --delay=1800 /dev/md1" >> /home/raid-monitor.sh; echo -e "/home/raid-monitor.sh" >> /etc/rc.d/rc.local; chmod +x /home/raid-monitor.sh; chmod +x /etc/rc.d/rc.local
The above command will create a bash script which includes the same command as the first section, this is then appended to the rc.local file and made an executable file. On boot, the bash script will execute and issue the monitoring command. Below is all the commands on their own, instead of chained.
echo -e "mdadm --monitor --daemonise --mail=raid-monitor+0xc47[email protected] --delay=1800 /dev/md1" >> /home/raid-monitor.sh
echo -e "/home/raid-monitor.sh" >> /etc/rc.d/rc.local
chmod +x /home/raid-monitor.sh
chmod +x /etc/rc.d/rc.local