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
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
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:
quoted
# 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
quoted
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.
quoted
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