Commit e7c91d83 authored by fwinkler's avatar fwinkler

Changed mail script for error info.

parent aba5e9af
......@@ -10,7 +10,8 @@ touch $ERROR_FILE
# grep for various errors in logfile
echo "search for errors in collectd log file:"
cat $COLLECTD_LOGFILE | grep -i "error" >> $ERROR_FILE
grep -m 10 -i "error" $COLLECTD_LOGFILE >> $ERROR_FILE
grep -m 1 "uc_update" $COLLECTD_LOGFILE >> $ERROR_FILE
# search for error in debug output (only for files not older than 1 day)
files="$(find /tmp/pika_debug/pika_* -mtime -1)"
if [ ! -z "$files" ]; then
......
......@@ -3,8 +3,20 @@
ERROR_COLLECTION_PATH=/sw/taurus/tools/pika/logs/$(date +"%d-%m-%Y")
SUBJECT="[PIKA] found erros"
# send email log exists
MESSAGE=/tmp/pika_email_message
touch $MESSAGE
echo "Errors per node are listed in ${ERROR_COLLECTION_PATH}." >> $MESSAGE
echo "" >> $MESSAGE
cd $ERROR_COLLECTION_PATH
ERROR_COUNT=$(ls | wc -l)
echo "Number of nodes containing errors: ${ERROR_COUNT}" >> $MESSAGE
echo "" >> $MESSAGE
ls -1 >> $MESSAGE
# send if email log exists
if [ -d "$ERROR_COLLECTION_PATH" ]; then
mail -S smtp=mailin5.zih.tu-dresden.de -s "$SUBJECT" -r $HOSTNAME@taurus.hrsk.tu-dresden.de frank.winkler@tu-dresden.de <<< $ERROR_COLLECTION_PATH
mail -S smtp=mailin5.zih.tu-dresden.de -s "$SUBJECT" -r $HOSTNAME@taurus.hrsk.tu-dresden.de robert.dietrich@tu-dresden.de <<< $ERROR_COLLECTION_PATH
fi
\ No newline at end of file
mail -S smtp=mailin5.zih.tu-dresden.de -s "$SUBJECT" -r $HOSTNAME@taurus.hrsk.tu-dresden.de frank.winkler@tu-dresden.de < $MESSAGE
mail -S smtp=mailin5.zih.tu-dresden.de -s "$SUBJECT" -r $HOSTNAME@taurus.hrsk.tu-dresden.de robert.dietrich@tu-dresden.de < $MESSAGE
fi
rm $MESSAGE
#!/bin/bash
sh /sw/taurus/tools/pika/daemon/logrotate/pika_mail_errors.sh
sh /sw/taurus/tools/pika/daemon/logrotate/pika_collect_errors.sh
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment