
#!/bin/sh
# File	: get_dfm_cpu-too-busy.sh
# By	: Maarten de Boer, 100608
# Subject	: Get the list of all CPU-too-Busy events from DFM

PGM="`basename ${0}|cut -d\. -f1`"
TMP="/tmp/${PGM}.$$"
MAILTO="maarten.deboer@atosorigin.com"

touch ${TMP}

/usr/bin/dfm event list | grep cpu-too-busy | awk '{print $1}'| while read ID
do
  /usr/bin/dfm event detail ${ID} | egrep -e 'cpuTooBusyThreshold |eventCondition|eventTimestamp|objFullName' >> ${TMP}
done

cat ${TMP} | unix2dos | uuencode ${PGM}.txt | mailx -s "[${PGM}]" ${MAILTO}

rm ${TMP}
exit

