diff --git a/psi-alerts.sh b/psi-alerts.sh index c4f2a7e..17b8fc4 100755 --- a/psi-alerts.sh +++ b/psi-alerts.sh @@ -132,7 +132,7 @@ send () { local psi="$(print_psi $(tr '[[:upper:]]' '[[:lower:]]' <<< ${psi_type}))" - local email=$(mktemp /tmp/psi.eml.XXXX) + local email=$(mktemp /tmp/psi.eml.XXXX.txt) local subj printf "Pressure Stall Information for ${host} triggered on ${psi_type} at $(date +'%FT%T %Z')\n\n" > ${email} if [[ -n "${current_alarms}" ]]; then @@ -154,10 +154,12 @@ send () { fi # send the message - /usr/bin/mail -m ${email} --resource-files=/ \ - --subject="${subj}" \ - --end-options \ - ${dst} + ( + printf "To: ${dst}\n" + printf "Subject: ${subj}\n" + cat ${email} + ) | sendmail -t + #set +x }