* mdadm and --program
@ 2002-10-03 20:01 Jeff Byrkit
2002-10-03 20:59 ` Derek Vadala
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Byrkit @ 2002-10-03 20:01 UTC (permalink / raw)
To: linux-raid
Hello all,
I want to use mdadm to email me with all of the events, not just the Fail and
FailSpare events. So I need to use --program. On another terminal, I fail,
remove, and add one of the raid5 disks. I try using mdadm like this:
# mdadm --follow --program /etc/handle-mdadm-events --delay 1 /dev/md0
where handle-mdadm-events is (culled from previous posts):
echo $*
logger -p kern.crit -t RAID $*
but I never get anything at my terminal or in the log. If I don't use the
--program, it gives me:
linuxsc:/home/pcpao # mdadm --follow --delay 1 /dev/md0
Oct 3 09:47:52: FailSpare on /dev/md0 /dev/sdf
anyone have any ideas? can I do --program "echo $*" ? just to get it to do
something?
linuxsc:/etc # cat /proc/version
Linux version 2.4.18-64GB-SMP (root@SMP_X86.suse.de) (gcc version 2.95.3
20010315 (SuSE)) #1 SMP Wed Mar 27 13:58:12 UTC 2002
jeff b
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mdadm and --program
2002-10-03 20:01 mdadm and --program Jeff Byrkit
@ 2002-10-03 20:59 ` Derek Vadala
2002-10-04 11:45 ` Jeff Byrkit
2002-10-05 0:12 ` Neil Brown
0 siblings, 2 replies; 4+ messages in thread
From: Derek Vadala @ 2002-10-03 20:59 UTC (permalink / raw)
To: Jeff Byrkit; +Cc: linux-raid
On Thu, 3 Oct 2002, Jeff Byrkit wrote:
> # mdadm --follow --program /etc/handle-mdadm-events --delay 1 /dev/md0
>
> where handle-mdadm-events is (culled from previous posts):
>
> echo $*
> logger -p kern.crit -t RAID $*
Does your script have a #! line at the top, for example:
#!/bin/bash
You could alternatively use:
# mdadm --follow --program='/bin/bash /etc/handle-mdadm-events' --delay=1 /dev/md0
> but I never get anything at my terminal or in the log. If I don't use the
> --program, it gives me:
Don't forget to make sure /etc/syslog.conf has an appropriate entry too.
> anyone have any ideas? can I do --program "echo $*" ? just to get it to do
> something?
Yeah, but you don't need $* and you should use the full path to echo.
# mdadm -F /dev/md0 -p/bin/echo -d1
---
Derek Vadala, derek@cynicism.com, http://www.cynicism.com/~derek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mdadm and --program
2002-10-03 20:59 ` Derek Vadala
@ 2002-10-04 11:45 ` Jeff Byrkit
2002-10-05 0:12 ` Neil Brown
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Byrkit @ 2002-10-04 11:45 UTC (permalink / raw)
To: Derek Vadala; +Cc: linux-raid
Excellent. I'm new to scripting...guess it's time for this old vms hack to
learn shell programming....
Thanks again.
On Thursday, October 03 2002 04:59 pm, Derek Vadala wrote:
> On Thu, 3 Oct 2002, Jeff Byrkit wrote:
> > # mdadm --follow --program /etc/handle-mdadm-events --delay 1 /dev/md0
> >
> > where handle-mdadm-events is (culled from previous posts):
> >
> > echo $*
> > logger -p kern.crit -t RAID $*
>
> Does your script have a #! line at the top, for example:
>
> #!/bin/bash
>
> You could alternatively use:
>
> # mdadm --follow --program='/bin/bash /etc/handle-mdadm-events' --delay=1
> /dev/md0
>
> > but I never get anything at my terminal or in the log. If I don't use the
> > --program, it gives me:
>
> Don't forget to make sure /etc/syslog.conf has an appropriate entry too.
>
> > anyone have any ideas? can I do --program "echo $*" ? just to get it to
> > do something?
>
> Yeah, but you don't need $* and you should use the full path to echo.
>
> # mdadm -F /dev/md0 -p/bin/echo -d1
>
> ---
> Derek Vadala, derek@cynicism.com, http://www.cynicism.com/~derek
>
> -
> 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
--
Jeff Byrkit
Assistant Deputy for Information Systems
Pinellas County Property Appraiser
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mdadm and --program
2002-10-03 20:59 ` Derek Vadala
2002-10-04 11:45 ` Jeff Byrkit
@ 2002-10-05 0:12 ` Neil Brown
1 sibling, 0 replies; 4+ messages in thread
From: Neil Brown @ 2002-10-05 0:12 UTC (permalink / raw)
To: Derek Vadala; +Cc: Jeff Byrkit, linux-raid
On Thursday October 3, derek@cynicism.com wrote:
> You could alternatively use:
>
> # mdadm --follow --program='/bin/bash /etc/handle-mdadm-events' --delay=1 /dev/md0
>
This would only work if '/bin/bash /etc/handle-mdadm-events' was a
program.
i.e. if 'handle-mdadm-events' were a file in the directory 'etc' in
the directory 'bash ' in the directory 'bin'. Which is unlikely.
NeilBrown
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-10-05 0:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-03 20:01 mdadm and --program Jeff Byrkit
2002-10-03 20:59 ` Derek Vadala
2002-10-04 11:45 ` Jeff Byrkit
2002-10-05 0:12 ` 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).