LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-02-2011, 07:47 PM   #16
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,044

Original Poster
Rep: Reputation: Disabled

Code:
bash-4.1# /etc/rc.d/rc.mdadm restart
Stopping Mdadm monitor : Success
mdadm: Monitor using email address "email@gmail.com" from config file
So does it mean that it should work? SO for better overall understanding, does it continuously monitor the arrays (real time) or will probe the arrays on a time basis (like every 10 minutes)?

All I want is at the moment a drive fails or a array fails, I immediately get an email saying "drive sd? of array md? failed" or something like that.

What do you think?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-03-2011, 10:32 AM   #17
granth
Member
 
Registered: Jul 2004
Location: USA
Distribution: Slackware64
Posts: 212

Rep: Reputation: 55
The default poll interval is 60 seconds.
 
Old 05-03-2011, 11:09 AM   #18
vulcan59
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 14.2 & Current
Posts: 96

Rep: Reputation: 30
Quote:
Originally Posted by lpallard View Post
All I want is at the moment a drive fails or a array fails, I immediately get an email saying "drive sd? of array md? failed" or something like that.
Which is exactly what happens for me with my setup which I posted earlier. I have never looked at or used the rc.mdadm script you refer to so I have no idea if it will do what you want. Why not try my way and see if it works for you? It's simple enough to try.
 
Old 05-03-2011, 03:58 PM   #19
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,044

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by granth View Post
The default poll interval is 60 seconds.
Yeah but you need to specify -d for that feature to be true?

I tried vulcan's method, with this test:

Code:
mdadm /dev/md0 --fail /dev/sda1
mdadm /dev/md0 --remove /dev/sda1
mdadm /dev/md0 --add /dev/sda1
it sent an email. Why rc.mdadm wont send an email?

the command that starts mdadm in rc.mdadm is simply:

Code:
start() {
	if [ "X${MDPID}" = "X" ];then
                ${PROG} --monitor --daemonise "${DEVICES}" > ${PIDFILE}
	else
		echo "Mdadm Monitor already running :"
		exit 1
	fi
}
with
Code:
PIDFILE="/var/run/mdadm"
CONFIG="/etc/mdadm.conf"
PROG="/sbin/mdadm"
DEVICES="/dev/md[0-9]"
Basically, rc.mdadm's command is:
Code:
/sbin/mdadm --monitor --daemonise /dev/md[0-9]
And you guys are using these commands:
Code:
/sbin/mdadm -F --scan -m dave@pc1 -f -d 600
/sbin/mdadm --monitor --scan -f -d 120
Regorganized, these commands are exactly the same, with the exception that the command in rc.mdadm does not scan or specify an email address since it relies on mdadm.conf to be populated and also that you guys are specifying the poll time. If mdadm polling defaults to 60sec then these commands are all the same...

I'm puzzled... Why wouldnt I receive an email with rc.mdadm's command??

Last edited by lpallard; 05-03-2011 at 04:00 PM.
 
Old 05-03-2011, 04:45 PM   #20
vulcan59
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 14.2 & Current
Posts: 96

Rep: Reputation: 30
Looking at what works and what doesn't it seems that --scan is significant. This is what the man page says.
Code:
-s, --scan
              Scan config file or /proc/mdstat for missing information.  In general,  this
              option gives mdadm permission to get any missing information (like component
              devices, array devices, array identities, and alert  destination)  from  the
              configuration  file
From that I would guess that mdadm isn't accessing the config file if you don't specify --scan.
 
Old 05-03-2011, 05:31 PM   #21
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by vulcan59 View Post
From that I would guess that mdadm isn't accessing the config file if you don't specify --scan.
No it's definitely accessing the config file as it's picking up the email address correctly.

This is from the man page
Quote:
If any devices are listed on the command line, mdadm will only monitor those devices. Otherwise all arrays listed in the configura-
tion file will be monitored. Further, if --scan is given, then any other md devices that appear in /proc/mdstat will also be moni-
tored.
So it would seem that while the arrays are being specified they may be being ignored.

@lpallard

What happens if you write out the DEVICES as "/dev/md0 /dev/md1 /dev/md2" etc?

I'm thinking that perhaps the md[0-9] is not being evaluated correctly for some reason, I think perhaps it's the quotes surrounding /dev/md[0-9]

Last edited by mRgOBLIN; 05-03-2011 at 05:36 PM.
 
Old 05-03-2011, 06:31 PM   #22
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,044

Original Poster
Rep: Reputation: Disabled
OK but why do you need to specify DEVICES if mdadm will anyways use the config file??? The arrays are all specified in there.

Also, I tried to change

Code:
DEVICES="/dev/md[0-9]"
by

Code:
DEVICES="/dev/md0 /dev/md1 /dev/md2 /dev/md........."
but same thing. No emails were sent.

Any more clues?
 
Old 05-03-2011, 07:01 PM   #23
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by lpallard View Post
OK but why do you need to specify DEVICES if mdadm will anyways use the config file??? The arrays are all specified in there.
Well it allows you to monitor only specific devices.

Ok I think I have it figured out.

Silly mistake on my part I think.

Remove the quotes from around both of these like this
Code:
DEVICES=/dev/md[0-9]
Note: (you'll need to keep the quotes above if you specify a space separated list)
and
Code:
 ${PROG} --monitor --daemonise ${DEVICES} > ${PIDFILE}
I think that will work for you.

Last edited by mRgOBLIN; 05-03-2011 at 07:12 PM. Reason: Clarification
 
2 members found this post helpful.
Old 05-03-2011, 07:24 PM   #24
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,044

Original Poster
Rep: Reputation: Disabled
Sound like its working!!!

I removed the quotes at both commands, and ran the --fail, --remove & later on the --add commands, and got this email:

Code:
This is an automatically generated mail message from mdadm
running on server

A Fail event had been detected on md device /dev/md4.

It could be related to component device /dev/sda8.

Faithfully yours, etc.

P.S. The /proc/mdstat file currently contains the following:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] 
md6 : active raid1 sde1[0] sdf1[1]
      1465135936 blocks [2/2] [UU]
      
md5 : active raid1 sda9[0] sdb9[1]
      253834880 blocks [2/2] [UU]
      
md4 : active raid1 sda8[2](F) sdb8[1]
      15366016 blocks [2/1] [_U]
      
md3 : active raid1 sda7[0] sdb7[1]
      10249344 blocks [2/2] [UU]
      
md2 : active raid1 sda6[0] sdb6[1]
      10249344 blocks [2/2] [UU]
      
md1 : active raid1 sda5[0] sdb5[1]
      20490752 blocks [2/2] [UU]
      
md0 : active raid1 sda1[0] sdb1[1]
      272960 blocks [2/2] [UU]
      
unused devices: <none>
Thanks to all!, especially Mr. Goblin!

Last edited by lpallard; 05-03-2011 at 07:41 PM.
 
1 members found this post helpful.
Old 05-03-2011, 08:22 PM   #25
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Good success at last.

Quote:
Thanks to all!, especially Mr. Goblin!
Actually thanks to your persistence it showed up a bug in the script.

I've updated the version on the site with the changes.

So Thanks lpallard =)
 
Old 05-03-2011, 08:30 PM   #26
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,044

Original Poster
Rep: Reputation: Disabled
Quote:
So Thanks lpallard =)
Anytime! Thats what I like about linux! we both benefit from that!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating detection of Internet USB dongle via udev Sylvester Incognito 5 07-03-2009 10:02 PM
Dual drive failure in RAID 5 (also, RAID 1, and LVM) ABL Linux - Server 6 05-27-2009 08:01 PM
ethernet card detection failure chytons Linux - Networking 1 04-07-2006 03:11 PM
Automating NDISWRAPPER on Slack 10 c0dy Linux - Wireless Networking 1 12-21-2004 12:39 PM
any hardware failure detection software? sanglih Linux - Software 6 07-12-2002 07:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration