LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-24-2012, 09:35 AM   #1
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 114

Rep: Reputation: 1
mdadm - email alerts


I'm running software RAID with mdadm, and have monitoring setup.
It is working, but is it possible to set it up, so I recieve repeating e-mails, lets say once an hour.

Currently it seems to be that it only recieves e-mails when a state changes?

Is the only solution, to create an command to execute with cron ?
example.

Code:
mdadm --monitor /var/run/mdadm/monitor.pid --scan --syslog

Last edited by LBM; 03-24-2012 at 09:37 AM.
 
Old 03-25-2012, 04:53 AM   #2
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 114

Original Poster
Rep: Reputation: 1
Oh well, already running as cron

Code:
cat /etc/cron.daily/mdadm 
#!/bin/sh
#
# cron.daily/mdadm -- daily check that MD devices are functional
#
# Copyright © 2008 Paul Slootman <paul@debian.org>
# distributed under the terms of the Artistic Licence 2.0

# As recommended by the manpage, run
#      mdadm --monitor --scan --oneshot
# every day to ensure that any degraded MD devices don't go unnoticed.
# Email will go to the address specified in /etc/mdadm/mdadm.conf .
#
set -eu

MDADM=/sbin/mdadm
[ -x $MDADM ] || exit 0 # package may be removed but not purged

exec $MDADM --monitor --scan --oneshot
 
Old 03-25-2012, 06:26 AM   #3
ianll
LQ Newbie
 
Registered: Jan 2011
Posts: 18

Rep: Reputation: 2
Good investigative work LBM.

That looks like it does what you want - yes?

You could move that script into /etc/cron.hourly/ and modify it to email you the output if that is not already happening by default.

Everything's possible,
ianll
 
Old 03-25-2012, 09:53 AM   #4
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 114

Original Poster
Rep: Reputation: 1
It is mailing me now, since i have my email in /etc/mdadm/mdadm.conf, and yes it does exactly what I want.
I've added this email yesterday, so the emails where first recieved after this. (Which is really the solution to the original problem/question)
 
  


Reply



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
[SOLVED] Nagios is not generating any email alerts mail4vijay Linux - General 3 12-13-2011 11:09 PM
email alerts with tripwire.. BlackHawk Linux - Security 8 06-10-2011 02:47 PM
squdGuard email alerts tekmann33 Linux - Software 0 05-30-2010 02:15 PM
How do i setup email alerts? mjpowersjr Linux - Networking 4 11-23-2004 01:10 AM
logdrake email alerts joshx Mandriva 3 02-20-2004 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:48 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