#1  
Old 19th July 2006, 13:06
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default RAID monitoring

Hey

Anyone knows a nice RAID monitoring tool? I know that md's tools have build-in raid tool that informs you when something is wrong but i would also like some weblike tool. Similar to munin for example where it shows status of array, detailed info of all arrays and so on.. Been searching for it for quite a while yet i can't find anything usefull..
Reply With Quote
Sponsored Links
  #2  
Old 20th July 2006, 12:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

It seems as if you can do it with Zabbix: http://www.zabbix.com/forum/showthread.php?t=3135
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 20th July 2006, 15:09
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default

omg i'm so stupid, yes, a script that's checking that and cronjob that checks it every 10 min! If raid array is broken, it emails me..

That's not a big cpu and memory consumer if i'm checking small text file every 10 min with cronjob is it?

And we have a solution!
Reply With Quote
  #4  
Old 20th July 2006, 15:20
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,036
Thanks: 268
Thanked 152 Times in 132 Posts
Default

Nice one.. Zabbix .. Now all we need is a good Howto for Debian :-)
I've done the zabbix_network_monitoring severall times now (on a virtual Debian), but till now with no luck :/
Reply With Quote
  #5  
Old 21st July 2006, 12:33
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default

Code:
#!/bin/bash
# Usage: check_raid.sh

ra=(md0 md1 md2) #all available raid arrays
count_ra=${#ra}

for ((i=0;i<$count_ra;i++)); do
if [ $(grep -A1 ${ra[${i}]} /proc/mdstat | grep UU | wc -l) -eq 0 ]; then

#send email if one the raid arrays fails..
mdadm --detail /dev/${ra[${i}]} | mail -s "${ra[${i}]} RAID Array failed" alert@domain.tpl

fi
done
Probably not the best code but hey.. If someone can make it better it would be cool..
It works if you change it from -eq 0 to -eq 1 and it sends out emails for all raid arrays, haven't tested with 0

10 min cron job will be fine right?
Reply With Quote
  #6  
Old 21st July 2006, 13:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Quote:
Originally Posted by TheRudy
10 min cron job will be fine right?
I don't see any problems with that.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 21st July 2006, 16:46
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default

hmm a bit of a problem i might have

Any idea why it doesn't send data with email? To test it, i set 1 so if the arrays are OK, i get 3 emails, each email contains data about raid array (--detail /dev/md0 and so on...). Now the thing is, if i run this script manually, i receive 3 emails with raid data about each array! But if the cronjob does it, it sends 3 emails with subject as it should be but without any content!

cron looks like:
Code:
0,10,20,30,40,50 * * * * /usr/local/bin/check_raid.sh &> /dev/null
tested also with:
Code:
0,10,20,30,40,50 * * * * (/usr/local/bin/check_raid.sh | mail -s "test" alert@domain.tld)
as 4th email, i get:

Code:
Null message body; hope that's ok
Null message body; hope that's ok
Null message body; hope that's ok
I don't get it! mdadm --detail command isn't run with cronjob cause?
I set the ownership to root, script is 755, no errors..



edit: i put the file in /usr/local/bin, could that be a problem? Don't see how since i can run it manually from there without any problems and getting emails with data..
Reply With Quote
  #8  
Old 22nd July 2006, 14:57
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
Default

Duh!

You need full path in script else mdadm can't be found when the script is run by cronjob... Duh again..

Code:
/sbin/mdadm --detail /dev/${ra[${i}]} | mail -s "${ra[${i}]} RAID Array failed" alert@domain.tpl
Also moved file from old location to /root and hmm, well, it works
Reply With Quote
  #9  
Old 22nd July 2006, 15:30
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Quote:
Originally Posted by TheRudy
Duh!

You need full path in script else mdadm can't be found when the script is run by cronjob... Duh again..
Or you put something like this at the beginning of your script:

Code:
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 22nd July 2006, 16:23
TheRudy TheRudy is offline
Senior Member
 
Join Date: Dec 2005
Posts: 216
Thanks: 1
Thanked 7 Times in 5 Posts
 
Default

I'll just stick with my way..
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need to install raid 1, on linux, which controller do u suggest? lyndros Installation/Configuration 5 5th August 2007 11:06
Monitoring Postfix Via Browser pinguingilo Installation/Configuration 12 19th September 2006 13:36
Monitoring problem after 2.2.0 todvard Installation/Configuration 3 22nd March 2006 07:53
SATA Software RAID 1 on Linux mphayesuk Installation/Configuration 2 21st February 2006 11:31
Suse 10 RAID 1 How To mphayesuk Installation/Configuration 2 11th February 2006 04:56


All times are GMT +2. The time now is 04:27.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.