/etc/ha.d/resource.d/MailTo is in heartbeat 1:3.0.5-3ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #!/bin/sh
#
# Description: wrapper of OCF RA MailTo, based on original heartbeat RA.
# See OCF RA MailTo for more information.
#
# Author: Xun Sun <xunsun@cn.ibm.com>
# Support: linux-ha@lists.linux-ha.org
# License: GNU General Public License (GPL)
# Copyright: (C) 2005 International Business Machines
#
# This can be given in the haresources file as:
# MailTo::alanr@unix.sh::BigImportantWebServer
# MailTo::alanr@unix.sh,spoppi@gmx.de::BigImportantWebServer
#
# This will then be put into the message subject and body.
# Source function library.
. /etc/ha.d/resource.d//hto-mapfuncs
usage() {
echo "Usage: $0 <email> [<subject>] $LEGAL_ACTIONS"
exit 1
}
case "$#" in
0|1) echo "At least 1 Email address has to be given!"
usage
;;
2)
cmd=$2
OCF_RESKEY_email=$1
export OCF_RESKEY_email
;;
3)
cmd=$3
OCF_RESKEY_email=$1
OCF_RESKEY_subject=$2
export OCF_RESKEY_email OCF_RESKEY_subject
;;
*) echo "Additional parameters found: $# but max. 3 are allowed!"
usage;;
esac
OCF_TYPE=MailTo
OCF_RESOURCE_INSTANCE=${OCF_TYPE}
export OCF_TYPE OCF_RESOURCE_INSTANCE
ra_execocf $cmd
|