* mdadm --monitor
@ 2002-05-16 8:40 Danilo Godec
2002-05-16 10:11 ` Neil Brown
0 siblings, 1 reply; 8+ messages in thread
From: Danilo Godec @ 2002-05-16 8:40 UTC (permalink / raw)
To: linux-raid
Hi!
I'm trying out mdadm on a new system I'm building and it seems fine so
far. However, right now I'm tryoung the '--monitor' feature and
unfortunately it seems to do nothing...
[root]# cat /etc/mdadm.conf
DEVICE /dev/hd*[0-9] /dev/sd*[0-9]
ARRAY /dev/md0 level=raid1 num-devices=3 UUID=9338f6b6:ccadf20b:0fd08433:8285e108
ARRAY /dev/md1 level=raid5 num-devices=3 UUID=91bdf2b7:f6e83922:49437c5e:da5d7930
ARRAY /dev/md2 level=raid5 num-devices=3 UUID=5f7f8c33:a492a6a3:4129ff63:ac152b4b
MAILADDR raidalert
PROGRAM /usr/local/sbin/raidalert
[root]# cat /usr/local/sbin/raidalert:
#!/bin/bash
#
#
logger -p kern.crit -t RAID
[root]# cat /proc/mdstat
Personalities : [raid1] [raid5]
read_ahead 1024 sectors
md0 : active raid1 hde1[2] hdi1[0] hdg1[1]
56128 blocks [3/3] [UUU]
md1 : active raid5 hde2[3] hdi2[0] hdg2[1]
118912896 blocks level 5, 32k chunk, algorithm 2 [3/2] [UU_]
[===========>.........] recovery = 55.9% (33294676/59456448) finish=13.9min speed=31157K/sec
md2 : active raid5 hde3[2] hdi3[0] hdg3[1]
1076224 blocks level 5, 32k chunk, algorithm 2 [3/3] [UUU]
root# mdadm --monitor --scan -d 5
I think it should report at least something to my syslog ('echo "Test" |
/usr/local/sbin/raidalert' does!), but it doesn't...
What am I doing wrong?
Thanks, D.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mdadm --monitor
2002-05-16 8:40 Danilo Godec
@ 2002-05-16 10:11 ` Neil Brown
2002-05-17 6:43 ` Danilo Godec
0 siblings, 1 reply; 8+ messages in thread
From: Neil Brown @ 2002-05-16 10:11 UTC (permalink / raw)
To: Danilo Godec; +Cc: linux-raid
On Thursday May 16, danci@agenda.si wrote:
> Hi!
>
> I'm trying out mdadm on a new system I'm building and it seems fine so
> far. However, right now I'm tryoung the '--monitor' feature and
> unfortunately it seems to do nothing...
...
> [root]# cat /usr/local/sbin/raidalert:
>
> #!/bin/bash
> #
> #
>
> logger -p kern.crit -t RAID
>
Try
logger -p kern.crit -t RAID $*
the program doesn't get anything on stdin. I just gets 2 or three
command-line arguments.
NeilBrown
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mdadm --monitor
2002-05-16 10:11 ` Neil Brown
@ 2002-05-17 6:43 ` Danilo Godec
2002-05-17 6:59 ` Neil Brown
0 siblings, 1 reply; 8+ messages in thread
From: Danilo Godec @ 2002-05-17 6:43 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
On Thu, 16 May 2002, Neil Brown wrote:
> > [root]# cat /usr/local/sbin/raidalert:
> >
> > #!/bin/bash
> > #
> > #
> >
> > logger -p kern.crit -t RAID
> >
>
>
> Try
> logger -p kern.crit -t RAID $*
>
> the program doesn't get anything on stdin. I just gets 2 or three
> command-line arguments.
Oh, I see! Yes, this way it does work... :)
Maybe you should explain this explicitly or even add the above example to
the docs.
D.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mdadm --monitor
2002-05-17 6:43 ` Danilo Godec
@ 2002-05-17 6:59 ` Neil Brown
0 siblings, 0 replies; 8+ messages in thread
From: Neil Brown @ 2002-05-17 6:59 UTC (permalink / raw)
To: Danilo Godec; +Cc: linux-raid
On Friday May 17, danci@agenda.si wrote:
> On Thu, 16 May 2002, Neil Brown wrote:
>
> > > [root]# cat /usr/local/sbin/raidalert:
> > >
> > > #!/bin/bash
> > > #
> > > #
> > >
> > > logger -p kern.crit -t RAID
> > >
> >
> >
> > Try
> > logger -p kern.crit -t RAID $*
> >
> > the program doesn't get anything on stdin. I just gets 2 or three
> > command-line arguments.
>
> Oh, I see! Yes, this way it does work... :)
>
> Maybe you should explain this explicitly or even add the above example to
> the docs.
>
> D.
>
The documentation in mdadm.conf.5 seems suitably explicit:
The
.B program
line gives the name of a program to be run when
.B "mdadm --monitor"
detects potentially interesting events on any of the arrays that it
is monitoring. This program gets run with two or three arguments, they
being the Event, the md device, and possibly the related component
device.
mdadm.8 however doesn't seem explicit at all :-(
I have added:
When passing event to program, the program is run once for each event
and is given 2 or 3 command-line arguements. The first is the
name of the event (see below). The second is the name of the
md device which is affected, and the third is the name of a related
device if relevant, such as a componenet device that has failed.
just after
The result of monitoring the arrays is the generation of events.
These events are passed to a separate program (if specified) and may
be mailed to a given E-mail address.
Thanks,
NeilBrown
^ permalink raw reply [flat|nested] 8+ messages in thread
* mdadm --monitor
@ 2003-01-29 14:59 danci
2003-02-13 9:10 ` Neil Brown
0 siblings, 1 reply; 8+ messages in thread
From: danci @ 2003-01-29 14:59 UTC (permalink / raw)
To: linux-raid
Hi!
I'm trying to use mdadm to monitor my Linux RAID stuff, but it fails to
send an email and/or run the program:
/etc/mdadm.conf
DEVICE /dev/hd*
ARRAY /dev/md0 uuid=9338f6b6:ccadf20b:0fd08433:8285e108
ARRAY /dev/md1 uuid=91bdf2b7:f6e83922:49437c5e:da5d7930
ARRAY /dev/md2 uuid=5f7f8c33:a492a6a3:4129ff63:ac152b4b
MAILADDR raidalert
PROGRAM /usr/local/sbin/raidalert
'raidalert' is an alias for my account. If I do 'ls | mail raidalert', I
get a mail containin the directory listing...
/usr/local/sbin/raidalert is very simple (for now) and it works:
#!/bin/bash
/usr/bin/logger -p user.crit -t raidalert $@
So I guess I'm all set. I try 'mdadm --fail /dev/md0 /dev/hdg1' and wait.
On the console, where 'mdadm --monitor' is running, I get this:
Jan 29 15:48:25: FailSpare on /dev/md0 /dev/hdg1
But why doesn't it send the mail and/or run the program??
Thanks, D.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mdadm --monitor
2003-01-29 14:59 mdadm --monitor danci
@ 2003-02-13 9:10 ` Neil Brown
2003-02-13 14:22 ` danci
0 siblings, 1 reply; 8+ messages in thread
From: Neil Brown @ 2003-02-13 9:10 UTC (permalink / raw)
To: danci; +Cc: linux-raid
On Wednesday January 29, danci@agenda.si wrote:
> Hi!
>
> I'm trying to use mdadm to monitor my Linux RAID stuff, but it fails to
> send an email and/or run the program:
>
> /etc/mdadm.conf
>
> DEVICE /dev/hd*
> ARRAY /dev/md0 uuid=9338f6b6:ccadf20b:0fd08433:8285e108
> ARRAY /dev/md1 uuid=91bdf2b7:f6e83922:49437c5e:da5d7930
> ARRAY /dev/md2 uuid=5f7f8c33:a492a6a3:4129ff63:ac152b4b
> MAILADDR raidalert
> PROGRAM /usr/local/sbin/raidalert
>
> 'raidalert' is an alias for my account. If I do 'ls | mail raidalert', I
> get a mail containin the directory listing...
>
> /usr/local/sbin/raidalert is very simple (for now) and it works:
>
> #!/bin/bash
> /usr/bin/logger -p user.crit -t raidalert $@
>
> So I guess I'm all set. I try 'mdadm --fail /dev/md0 /dev/hdg1' and wait.
> On the console, where 'mdadm --monitor' is running, I get this:
Try adding "--scan" to the "mdadm --monitor" command.
I can see this is not intuitive - I'll try to tidy up for mdadm-1.1
NeilBrown
>
> Jan 29 15:48:25: FailSpare on /dev/md0 /dev/hdg1
>
> But why doesn't it send the mail and/or run the program??
>
> Thanks, D.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: mdadm --monitor
2003-02-13 9:10 ` Neil Brown
@ 2003-02-13 14:22 ` danci
0 siblings, 0 replies; 8+ messages in thread
From: danci @ 2003-02-13 14:22 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
On Thu, 13 Feb 2003, Neil Brown wrote:
> On Wednesday January 29, danci@agenda.si wrote:
> > #!/bin/bash
> > /usr/bin/logger -p user.crit -t raidalert $@
> >
> > So I guess I'm all set. I try 'mdadm --fail /dev/md0 /dev/hdg1' and wait.
> > On the console, where 'mdadm --monitor' is running, I get this:
>
> Try adding "--scan" to the "mdadm --monitor" command.
> I can see this is not intuitive - I'll try to tidy up for mdadm-1.1
Nice, this works now.
Thanks, D.
^ permalink raw reply [flat|nested] 8+ messages in thread
* mdadm --monitor
@ 2004-08-14 6:45 Brad Campbell
0 siblings, 0 replies; 8+ messages in thread
From: Brad Campbell @ 2004-08-14 6:45 UTC (permalink / raw)
To: RAID Linux
G'day all,
This is just a little public thankyou to Neil Brown.
mdadm --monitor mode with E-mail notification just saved my backside.
Cheers!
Regards,
Brad
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-08-14 6:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-29 14:59 mdadm --monitor danci
2003-02-13 9:10 ` Neil Brown
2003-02-13 14:22 ` danci
-- strict thread matches above, loose matches on Subject: below --
2004-08-14 6:45 Brad Campbell
2002-05-16 8:40 Danilo Godec
2002-05-16 10:11 ` Neil Brown
2002-05-17 6:43 ` Danilo Godec
2002-05-17 6:59 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).