You are not logged in.

#1 2017-08-19 01:07:47

nachopro
Member
Registered: 2013-08-23
Posts: 78

[SOLVED] mdadm monitor s-nail / mail command

Hi! I'm using mdadm --monitor

I followed this article: https://wiki.archlinux.org/index.php/RA … ive_method but the body of email is blank.

How I can get working these notifications without sendmail?

PS: I suspect that mdadm writes the body message vía STDIN but I don't know how to capture it properly under bash scripting.

I tried without success (appears to be that EOF is missing and script become stuck)

#!/bin/bash

echo $(</dev/stdin)

Thanks

Last edited by nachopro (2017-08-19 02:52:26)

Offline

#2 2017-08-19 01:21:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] mdadm monitor s-nail / mail command

What, exactly, do you expect to appear in the email body? Please paste your full script.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-08-19 01:34:41

nachopro
Member
Registered: 2013-08-23
Posts: 78

Re: [SOLVED] mdadm monitor s-nail / mail command

jasonwryan Thanks for you response!

Look, I created a fake /usr/bin/sendmail file with these code

#!/bin/bash

echo $(</dev/stdin)

Then I set MAILADDR address@server.com in /etc/mdadm.conf (PROGRAM was commented) and ran mdadm --monitor --scan --oneshot --test

OUTPUT:

# mdadm --monitor --scan --oneshot --test
From: mdadm monitoring <root> To: address@server.com Subject: TestMessage event on /dev/md0:keller This is an automatically generated mail message from mdadm running on keller A TestMessage event had been detected on md device /dev/md0. Faithfully yours, etc. P.S. The /proc/mdstat file currently contains the following: Personalities : [raid10] md0 : active raid10 sdd1[2] sdc1[1] sdb1[0] 1464832512 blocks super 1.2 512K chunks 2 far-copies [3/3] [UUU] [=====>...............] resync = 25.9% (379739968/1464832512) finish=349.7min speed=51709K/sec unused devices: <none>

Using the example in Arch's Wiki (using PROGRAM) I only receive the Subject but not the body that mdadm generates

I want to receive the message produced by mdadm in my email account using the PROGRAM option (to avoid install sendmail) but i don't know how to achieve that.

Thanks

Last edited by nachopro (2017-08-19 01:40:46)

Offline

#4 2017-08-19 02:52:12

nachopro
Member
Registered: 2013-08-23
Posts: 78

Re: [SOLVED] mdadm monitor s-nail / mail command

ok snail, go home!

I installed ssmtp, thanks for your time!

Offline

Board footer

Powered by FluxBB