Unanswered: Monitoring db2diag.log, is there a better way ??
I am planning to write a script ( AIX 5.3 - DB2 v9.1.0 ) to monitor the errors recorded in diaglog file. As of now I am thinking it can be done using
with various options to filter the severities/ databases / and time spans.
Second thing is that I may parse the db2diag.log file with shell or perl script and process it myself. This may be faster or at least will incur no cpu to db2.
Please correct me if I am wrong.
Here is my worry. If the diaglog grows multiples of megabytes overnight, will db2diag.exe take for ever to sort out lastnight's entries ?? Script (shell or perl) will.
Another question comes up - does db2 keep these errors in some catalogs (tables) or only db2diag.log ?
Please shed some light and correct me where am I wrong !!
try to cut-off the diag.log each day with db2diag -A
db2diag is the easiest tool to filter-display lines from this file.. and allows filename as parameter - and from timestamp - to timestamp . no this data is only available in diag.log
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be
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:
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
# email report file
# Code removed for privacy
# archive db2diag
db2diag -facility ALL -A /logs/db2diag_logs/