
#!/bin/sh
## mail_status.sh
#@ MaartenDeBoer.nl, 140717
#= Script om server-status retour te mailen

PGM="`basename $0|cut -d\. -f1`"
TMP="/tmp/${PGM}.$$"
MAILTO="${1}"
HOSTNAME="`hostname|cut -d\. -f1`"

echo "`date` MAILTO=${MAILTO}" >>  ${HOME}/log/${PGM}.log

echo "`date`" >> ${TMP}
echo "`uptime`"  >> ${TMP}
echo "`uname -a`"  >> ${TMP}
echo "`df -h`"  >> ${TMP}

cat ${TMP}| mailx -s "@${HOSTNAME} status [${PGM}]" ${MAILTO}

rm ${TMP}
exit 0

