Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > AIX alog patter...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 2131 of 2317
Post > Topic >>

AIX alog pattern match

by Henry <snogfest_hosebeast@[EMAIL PROTECTED] > Jan 15, 2008 at 01:46 PM

I'd like to print each individual error from the AIX console log
for instance, there is an error at Wed Jan 16 at 00:44:18
the record finished either at EOF, or when the next error occurs, in
this case, (we have some Firmware problems :) 05:45
will be the record separator.
I don't like to put output to files if I can avoid it so it'll be
alog -o -f /var/adm/ras/conslog |  awk '

I've got this bit to work (Korn Shell) counting all the records for
each calendar day, but would like to put something more meaningful in
the alert to Nagios. Yes, I know I don't need to use "set --" but I
just found it so wanted to play.

date_string=$(date +"%a %b %e")
set -- ${date_string}
week_day_name=$1
****ft
day_of_month=$1
****ft
month_name=$1
num_console_records=$(
alog -o -f /var/adm/ras/conslog | \
awk '
BEGIN {num_recs=0}
$1 == "0" && $2 == "'$week_day_name'" && $3 == "'$day_of_month'" && $4
== "'$month_name'" {++num_recs}
END {print num_recs}
'


         0 Tue Jan 15 20:37:47 NZDT 2008 Tue Jan 15 20:37:47 NZDT 2008
         0 Tue Jan 15 20:37:47 NZDT 2008 Automatic Error Log Analysis
for sysplanar0 has detected a problem.
The Service Request Number is
  B150E678: CEC hardware Predictive Error, general. Refer to the
system
            service do***entation for more information.
           Additional Words: 2-030000F0 3-28DA4810 4-C13920FF
5-400000FF
                             6-00000007 7-000002BD 8-00000000
9-00000000.
         0 Tue Jan 15 20:37:47 NZDT 2008
         0 Wed Jan 16 00:44:18 NZDT 2008
         0 Wed Jan 16 00:44:18 NZDT 2008 Wed Jan 16 00:44:18 NZDT 2008
         0 Wed Jan 16 00:44:18 NZDT 2008 Automatic Error Log Analysis
for sysplanar0 has detected a problem.
The Service Request Number is
  B150E67A: CEC hardware Predictive Error, degraded performance. Refer
to the
            system service do***entation for more information.
           Additional Words: 2-030000F0 3-28DA4810 4-C13920FF
5-400000FF
                             6-00000008 7-000003EC 8-00000000
9-00000000.
         0 Wed Jan 16 00:44:18 NZDT 2008
         0 Wed Jan 16 05:45:34 NZDT 2008
         0 Wed Jan 16 05:45:34 NZDT 2008 Wed Jan 16 05:45:34 NZDT 2008
         0 Wed Jan 16 05:45:34 NZDT 2008 Automatic Error Log Analysis
for sysplanar0 has detected a problem.
The Service Request Number is
  B150E678: CEC hardware Predictive Error, general. Refer to the
system
            service do***entation for more information.
           Additional Words: 2-030000F0 3-28DA4810 4-C13920FF
5-400000FF
                             6-00000007 7-000002BD 8-00000000
9-00000000.
         0 Wed Jan 16 05:45:34 NZDT 2008
         0 Wed Jan 16 07:59:03 NZDT 2008
         0 Wed Jan 16 07:59:03 NZDT 2008 Wed Jan 16 07:59:03 NZDT 2008
         0 Wed Jan 16 07:59:03 NZDT 2008 Automatic Error Log Analysis
for sysplanar0 has detected a problem.
The Service Request Number is
  B150E67A: CEC hardware Predictive Error, degraded performance. Refer
to the
            system service do***entation for more information.
           Additional Words: 2-030000F0 3-28DA4810 4-C13920FF
5-400000FF
                             6-00000009 7-000003EC 8-00000000
9-00000000.
         0 Wed Jan 16 07:59:03 NZDT 2008
 




 6 Posts in Topic:
AIX alog pattern match
Henry <snogfest_hosebe  2008-01-15 13:46:00 
Re: AIX alog pattern match
Ed Morton <morton@[EMA  2008-01-16 12:11:33 
Re: AIX alog pattern match
Hajo Ehlers <service@[  2008-01-16 10:19:13 
Re: AIX alog pattern match
Henry <snogfest_hosebe  2008-01-17 19:28:46 
Re: AIX alog pattern match
Henry <snogfest_hosebe  2008-01-17 19:30:53 
Re: AIX alog pattern match
Hajo Ehlers <service@[  2008-01-18 03:05:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:12:38 CDT 2008.