If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Monitoring db2diag.log, is there a better way ??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-22-11, 08:16
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Monitoring db2diag.log, is there a better way ??

Hi fellows,

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
db2diag.exe
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 !!

Regards

DBFinder
Reply With Quote
  #2 (permalink)  
Old 09-22-11, 08:30
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
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
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 09-22-11, 09:31
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #4 (permalink)  
Old 09-22-11, 16:48
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Thanks Guys,

I had implemented this sol in one windows env last year. That was successful.
Now I had your input as a confirmation.

Also special thanks Andy for the sample script.



Regards
DBFinder
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On