#!/bin/sh # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # pmie_email is intended for use in pmie actions to send e-mail. # # the one argument consists of a multi-line message, separated by # '|' characters ... # # "line" 1 - e-mail addressee, as passed to a mail program # "line" 2 - mail Subject: will be "pmie alert: " and then this # text # "line" 2,3,.. - body of the message [optional] # source the PCP configuration environment variables . /etc/pcp.env prog=`basename $0` if [ $# -ne 1 ] then echo "Usage: $prog long|format|message|as|one|argument" exit 1 fi if [ -z "$PCP_MUA" ] ; then for mua in Mail mailx; do if which $mua > /dev/null 2>&1 then PCP_MUA=`which $mua` break fi done fi if [ -z "$PCP_MUA" ] ; then echo "Cannot find a mail program" exit 1 fi cat <