[Pacemaker] email alerts on resource status

Francesco De Giorgi francesco.degiorgi at exact-lab.it
Mon Jun 9 07:03:46 EDT 2014


On Sat, Jun 7, 2014 at 4:23 PM, Andrew Beekhof <andrew at beekhof.net> wrote:
>
> On 7 Jun 2014, at 12:01 am, Francesco De Giorgi <francesco.degiorgi at exact-lab.it> wrote:
>
>> Hi all,
>> first post here.
>>
>> We are managing an HA Lustre filesystem with pacemaker 1.1.11 and
>> corosync 2.3.3 .
>> I was looking for a way to send email alerts to signal a Lustre target
>> migration, and I considered:
>>
>> - MailTo primitive
>> - cron script to parse crm_mon output
>> - nagios/icinga check
>> - ClusterMon primitive
>>
>> I compiled pacemaker-cli without smtp support,
>
> Ah, but you still have access to:
>
>  -E, --external-agent=value     A program to run when resource operations take place.
>  -e, --external-recipient=value A recipient for your program (assuming you want the program to send something to someone).
>
> for crm_mon, and your script can do whatever you like :)
>

Thanks Andrew,
I already tried the -E option on crm_mon and can't understand on what
conditions the external program is called.

This is my ClusterMon resource

primitive resMON ocf:pacemaker:ClusterMon \
  params user=root update=30 extra_options="-E /tmp/foo.sh" \
  operations $id="resMON-operations" \
  op monitor interval=10 timeout=20 on-fail=restart \
  op start timeout=20 interval=0 \
  op stop timeout=20 interval=0

clone resmon_clone resMON \
  meta globally-unique=false

and I can see the crm_mon daemon running this way (under root user)

/usr/sbin/crm_mon -p /tmp/ClusterMon_resMON.pid -d -i 0 -E /tmp/foo.sh
-h /tmp/ClusterMon_resMON.html

/tmp/foo.sh is just a touch to a file in /tmp.

But nothing happens. I straced the pid I found in
/tmp/ClusterMon_resMON.pid and, triggering a migration, found any
reference to my /tmp/foo.sh.

Am I doing something wrong?

Thanks again,
Francesco


>> so the ClusterMon would
>> be the last option.
>>
>> I was thinking to go with a MailTo primitive for each Lustre target,
>> and colocate them. Is this the easiest way, or something better
>> already exists?
>>
>> Thanks in advance,
>> Francesco
>>
>> _______________________________________________
>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs: http://bugs.clusterlabs.org
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
>



-- 
Francesco De Giorgi
eXact lab s.r.l.
+39 329 1529493
www.exact-lab.it




More information about the Pacemaker mailing list