We have a cron script that runs each day that breaks up the db2diag.log file into the different severity levels, and emails them to me. It then archives the db2diag.log file (which starts a new one fresh each day). It looks like this:
Code:
rm -f /tmp/db2diag*
# create report file
db2diag -facility ALL -l Error -o /tmp/db2diag_error.out
db2diag -facility ALL -l Severe -o /tmp/db2diag_severe.out
db2diag -facility ALL -l Critical -o /tmp/db2diag_critical.out
db2diag -facility ALL -l Event -o /tmp/db2diag_event.out
# make sure everything exists for email
touch /tmp/db2diag_error.out
touch /tmp/db2diag_severe.out
touch /tmp/db2diag_critical.out
touch /tmp/db2diag_event.out
# email report file
# Code removed for privacy
# archive db2diag
db2diag -facility ALL -A /logs/db2diag_logs/
Andy