From d931de5788961b7aa1c5b71165ec1edf42479ef0 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 14 Jan 2010 14:04:15 +0000 Subject: Save the entire log message in /var/log/security/ as well. --- cron-sh/security.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cron-sh/security.sh b/cron-sh/security.sh index 32dac9c..9a2d19d 100755 --- a/cron-sh/security.sh +++ b/cron-sh/security.sh @@ -31,6 +31,8 @@ fi # variables LCK=/var/run/msec-security.pid SECURITY_LOG="/var/log/security.log" +MAIL_LOG_TODAY="/var/log/security/mail.today" +MAIL_LOG_YESTERDAY="/var/log/security/mail.yesterday" # log formatting REPORT_DATE=`date "+%b %d %H:%M:%S"` @@ -99,8 +101,14 @@ if [[ -s ${SECURITY} ]]; then cat ${INFOS} | sed -e "s/^/$INFO_PREFIX/g" >> ${SECURITY_LOG} + # save the complete mail text somewhere + if [[ -f ${MAIL_LOG_TODAY} ]]; then + mv ${MAIL_LOG_TODAY} ${MAIL_LOG_YESTERDAY}; + fi + cat ${MSEC_TMP} > ${MAIL_LOG_TODAY} + Maillog "[msec] *** Security Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${MSEC_TMP}" - Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}" + Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Detailed results are available in ${MAIL_LOG_TODAY}" fi # diff check -- cgit v1.2.1