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 > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > AIX error log

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-06, 11:41
okdalst okdalst is offline
Registered User
 
Join Date: Mar 2006
Posts: 6
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...
Reply With Quote
  #2 (permalink)  
Old 04-26-06, 13:20
okdalst okdalst is offline
Registered User
 
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???
Reply With Quote
  #3 (permalink)  
Old 04-26-06, 14:34
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
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
Reply With Quote
  #4 (permalink)  
Old 04-26-06, 14:40
okdalst okdalst is offline
Registered User
 
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?
Reply With Quote
  #5 (permalink)  
Old 05-03-06, 08:04
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
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
Reply With Quote
  #6 (permalink)  
Old 05-15-06, 10:42
fwellers fwellers is offline
Registered User
 
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).
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