Bug#499492: paniclog warning sent to admin should containt paniclog
Andreas Metzler
ametzler at downhill.at.eu.org
Sun Sep 21 07:23:20 UTC 2008
tags 499492 pending
thanks
On 2008-09-19 Marc 'HE' Brockschmidt <he at debian.org> wrote:
[..]
> When exim4 is sending mail about a non-empty paniclog, it should include
> the last few lines from the log, so that the mailadmin knows if actual
> panic is needed or getting coffee first is an option.
;-)
> Too lazy to attach a real unified diff, but try this in cron.daily/exim4-base:
> if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: root\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail system might be broken:\n%s\n(last 10 lines)" "$(hostname --fqdn)" "$(hostname --fqdn)" "$(tail -n 10 /var/log/exim4/paniclog)"; ...
Diff used:
-------------------------
+++ exim4-base.cron.daily (Arbeitskopie)
@@ -13,6 +13,8 @@
E4BCD_DAILY_REPORT_TO=""
E4BCD_DAILY_REPORT_OPTIONS=""
E4BCD_WATCH_PANICLOG="yes"
+# Number of lines of paniclog quoted in warning email.
+E4BCD_PANICLOG_LINES="10"
E4BCD_PANICLOG_NOISE=""
# Only do anything if exim4 is actually installed
@@ -68,7 +70,10 @@
fi
if [ -z "$E4BCD_PANICLOG_NOISE" ] || grep -vq "$E4BCD_PANICLOG_NOISE" /var/log/exim4/paniclog; then
log_this "ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken"
- if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: root\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail system might be broken" "$(hostname --fqdn)" "$(hostname --fqdn)" | exim4 root; then
+ if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: root\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail system might be broken. Last ${E4BCD_PANICLOG_LINES} lines quoted below.\n\n%s\n" \
+ "$(hostname --fqdn)" "$(hostname --fqdn)" \
+ "$(tail -n "${E4BCD_PANICLOG_LINES}" /var/log/exim4/paniclog)" \
+ | exim4 root; then
log_this "PANIC: sending out e-mail warning has failed, exim has non-zero return code"
fi
if [ "$E4BCD_WATCH_PANICLOG" != "once" ]; then
-------------------------
> Thanks (this is annoying me so much that I would grant a freeze
> exception for this),
Commited, will be part of the next pre-lenny upload needed for i18 updates.
cu andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
More information about the Pkg-exim4-maintainers
mailing list