On 02/13/2011 11:04 AM, Mark Knecht wrote:
> Hi,
>    I'm curious about setting up my compute server to monitor RAID
> array status and have it email me information at my GMail account.
> Does anyone have info on setting this up on Gentoo? In general I'm
> following:
> 
> http://en.gentoo-wiki.com/wiki/RAID/Software
> 
> but it seems there are a few holes in my understanding.
> 
> 1) In the /etc/mdadm.conf file I see the following:
> 
> #
> # When used in --follow (aka --monitor) mode, mdadm needs a
> # mail address and/or a program.  This can be given with "mailaddr"
> # and "program" lines to that monitoring can be started using
> #    mdadm --follow --scan & echo $! > /var/run/mdadm
> # If the lines are not found, mdadm will exit quietly
> #MAILADDR r...@mydomain.tld
> #PROGRAM /usr/sbin/handle-mdadm-events
> 
> - Easy enough to change my email address, but how does it get mailed?
> Is this what ssmtp is for? ssmtp is installed as a dependency of sudo,
> but I don't use it explicitly. Do I have to have a real domain in my
> name to get GMail to accept this?

mdadm will use the sendmail command on your system. If you have ssmtp
installed, that's probably where your sendmail came from (I think all
providers of /usr/(s)bin/sendmail are mutually exclusive).

ssmtp usually needs some place to send the message; you can configure it
with the credentials of either your gmail or ISP account. It will
probably still send from root@localhost or whatever, but if you
authenticate with a username/password your ISP or gmail should accept it
just fine.


> - Currently have have no program called
> /usr/sbin/handle-mdadm-events. Is this just a placeholder for whatever
> program I choose as a mailer, or is this intended as some program that
> takes real action in case of a problem?

Placeholder, just an example of what you would put after the PROGRAM
directive.


> 2) I'm making the assumption that running rc-update add mdadm boot, as
> shown in the link above, is the way to get this started once
> configured properly?

The RAID will start automatically, mdadm just monitors it. So either
boot or default is fine.


> 3) I note that the test command listed in the link above doesn't work:
> 
> c2stable ~ # mdadm -Fslt
> mdadm: option -l not valid in monitor mode
> c2stable ~ #
> 
> 4) Assuming I do get this working, while testing can i have the
> program email me every 60 minutes whether things are good or bad, just
> to test that it's actually working and getting results?

I don't think you can get it to mail you when it's happy, but you can
simulate a failure:

  http://tldp.org/HOWTO/Software-RAID-HOWTO-6.html#ss6.3


Reply via email to