Results 1 to 6 of 6

Thread: AIX error log

  1. #1
    Join Date
    Mar 2006
    Posts
    6

    Unanswered: AIX error log

    Hi,

    I need help to get a script to extract the permanent hardware errors from the error log in AIX and then ignore ones that are more than 30 days old. I am redirecting errpt to a file called error_file and then doing awk -f test_script error_file. where test_script contains: #!/bin/ksh

    $4 ~ /H/ { print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 }

    so I get a summary of the hardware errors.But how can I get only ones newer than 30 days old? thanks in advance for help...

  2. #2
    Join Date
    Mar 2006
    Posts
    6
    Let me rephrase all this. Does anybody know how I could extract the permanent hardware errors in the error log that are less than a week, or say a month old???

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool



    Post and example of the output from your script.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  4. #4
    Join Date
    Mar 2006
    Posts
    6

    Question

    Here is what I get from my script:

    The following hardware errors are in the error log today
    ************************************************** ******
    0D09B489 0227123906 P H hdisk2 POLLED STATUS FAILURE
    3074FEB7 0227123906 T H fscsi1 ADAPTER ERROR
    3074FEB7 0227123906 T H fscsi1 ADAPTER ERROR
    3074FEB7 0227123906 T H fscsi1 ADAPTER ERROR
    3074FEB7 0227123906 T H fscsi1 ADAPTER ERROR
    B8113DD1 0227123706 T H fcs1 LINK ERROR

    but these are all old errors that have been there for a while. Is there a way to take apart that date field and just show new errors or nothing, like a comment saying no new errors today etc?

  5. #5
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    To only show new errors every time you invoke the script
    I suggest you store the line count (wc –l)
    and only check from that line onwards.

    if new count is less than previous_count i.e. New file
    then previous_count=0
    If no change in line count then exit else
    head +$((previous_count+1)) $error_log | egrep ‘ERROR|FAIL’
    and save the new line count

  6. #6
    Join Date
    May 2006
    Location
    Virginia
    Posts
    6
    Why not use errpt -s mmddhhmmyy as the excerpt from the man page shows ?


    -s StartDate
    Specifies all records posted on and after the StartDate variable, where the StartDate variable has
    the format mmddhhmmyy (month, day, hour, minute, and year).

Posting Permissions

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