Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008

    Unanswered: 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
    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 !!



  2. #2
    Join Date
    Apr 2006
    Provided Answers: 11
    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-V11 Fundamentals- DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  3. #3
    Join Date
    Jan 2003
    Provided Answers: 5
    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
    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/

  4. #4
    Join Date
    Sep 2008
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts