[ClusterLabs] Antw: Mail notifications

Jorge Lopes jmclopes at gmail.com
Fri May 15 08:23:23 EDT 2015


Thank you both.

> Check if you can send mail from the command line with the mail tool. Did
you
set up you local mail system properly? Do you use a relay host? What do the
logs

Yes, I can send emails form the command line.


> while sleep 60
> do
>    crm_mon -1 >/tmp/out
>    if [ -e /tmp/out.old ]; then
>      diff -u /tmp/out.old /tmp/out >/tmp.diff
>      if [ -s /tmp/out.diff ]; then
>        mailx -s "cluster change detected" to_you </tmp/out.diff
>    fi
>   mv /tmp/out /tmp/out.old
> done
>
> ## Just invented this script, so you get the idea, I hope...


Something like this would be my backup plan (using the crontab). But the
cluster is alreadly working as event driven and that would be my choice.


This is the resource I have setup:

primitive ClusterMon-SMTP ocf:pacemaker:ClusterMon \
    params user=pacemaker update=30s extra_options="-T support at myserver.com
-F no-reply at myserver.com -P PACEMAKER -H mail.myserver.com" \
    meta target-role=Started \
    op monitor interval=10s timeout=60s

clone ClusterMon-SMTP meta target-role="Started"

My guideline was:
http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/s-notification-email.html

No mail is sent.

But I also have seen this one:
http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/s-notification-external.html

I was wondering if the 1st approach has been used by anyone. Next, I'll try
the second approach.

Jorge


On Fri, May 15, 2015 at 9:44 AM, Ulrich Windl <
Ulrich.Windl at rz.uni-regensburg.de> wrote:

> >>> Jorge Lopes <jmclopes at gmail.com> schrieb am 15.05.2015 um 10:34 in
> Nachricht
> <CAASpg58Vhyv-TWhgrcWE5Qr0p4cWbgaCeDf-jyQ=ay5WGELmNw at mail.gmail.com>:
> > Hi
> > Is it possible to receive mail notifications on change events of the
> > cluster? E.g. a resource has been restarted or has been moved.
> >
> > I've see the resource type for cluster monitoring that uses crm_mon but
> > crm_mon never sends emails.
> >
> > I'm using pacemaker 1.1.12 with corosync.
> >
> > Any idea?
>
> while sleep 60
> do
>     crm_mon -1 >/tmp/out
>     if [ -e /tmp/out.old ]; then
>       diff -u /tmp/out.old /tmp/out >/tmp.diff
>       if [ -s /tmp/out.diff ]; then
>         mailx -s "cluster change detected" to_you </tmp/out.diff
>     fi
>    mv /tmp/out /tmp/out.old
> done
>
> ## Just invented this script, so you get the idea, I hope...
>
> >
> > Jorge
>
>
>
>
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20150515/347d4bad/attachment-0003.html>


More information about the Users mailing list