SEO

vBulletin Search Engine Optimization


Go Back   UnixAdminTalk.com > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 08:31 AM
Henry
 
Posts: n/a
Default AIX alog pattern match

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
shift
day_of_month=$1
shift
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 documentation 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 documentation 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 documentation 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 documentation 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
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 06:23 AM
Ed Morton
 
Posts: n/a
Default Re: AIX alog pattern match

On 1/15/2008 3:46 PM, Henry wrote:
> 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
> shift
> day_of_month=$1
> shift
> 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 documentation 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 documentation 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 documentation 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 documentation 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


I was waiting to see if anyone else could figure out what you were asking. I
couldn't make head nor tail of it. You may want to try again. This time posting
some small sample input that isn't line-wrapped by your newsreader (that part is
VERY important!), along with the expected output and the rationale.

Saying things like

> would like to put something more meaningful in
>> the alert to Nagios.


while no doubt being gratifying to "Nagios" is just not informative to most of
us reading the post. Similarly:

> there is an error at Wed Jan 16


doesn't tell us what it is in that record that tells you there's "an error".

Tell us exactly which records you want to select in your sample input based on
which values of which fields and what exactly you want to do with [which fields
of] those records.

Ed.

Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 06:23 AM
Hajo Ehlers
 
Posts: n/a
Default Re: AIX alog pattern match

On Jan 15, 10:46 pm, Henry <[email protected]> wrote:
> 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

.....

The conslog is normaly not the primary source of error information on
AIX. Thus you should take a look at the error log as well as the
possiblity to get information directly from the error daemon to a
syslog or nagios

or quick search:
http://users.ca.astound.net/baspence...rr_notify2.htm

hth
Hajo
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 05:51 AM
Henry
 
Posts: n/a
Default Re: AIX alog pattern match

On Jan 17, 7:19 am, Hajo Ehlers <[email protected]> wrote:
> On Jan 15, 10:46 pm, Henry <[email protected]> wrote:> 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

>
> ....
>
> The conslog is normaly not the primary source of error information on
> AIX. Thus you should take a look at the error log as well as the
> possiblity to get information directly from the error daemon to a
> syslog or nagios
>
> or quick search:http://users.ca.astound.net/baspence...rr_notify2.htm
>
> hth
> Hajo


I look through syslog, and the AIX errorlog, but, things do appear on
the console log too.
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 05:51 AM
Henry
 
Posts: n/a
Default Re: AIX alog pattern match

On Jan 17, 7:11 am, Ed Morton <[email protected]> wrote:
> On 1/15/2008 3:46 PM, Henry wrote:
>
>
>
> > 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
> > shift
> > day_of_month=$1
> > shift
> > 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 documentation 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 documentation 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 documentation 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 documentation 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

>
> I was waiting to see if anyone else could figure out what you were asking. I
> couldn't make head nor tail of it. You may want to try again. This time posting
> some small sample input that isn't line-wrapped by your newsreader (that part is
> VERY important!), along with the expected output and the rationale.
>
> Saying things like
>
> > would like to put something more meaningful in
> >> the alert to Nagios.

>
> while no doubt being gratifying to "Nagios" is just not informative to most of
> us reading the post. Similarly:
>
> > there is an error at Wed Jan 16

>
> doesn't tell us what it is in that record that tells you there's "an error".
>
> Tell us exactly which records you want to select in your sample input based on
> which values of which fields and what exactly you want to do with [which fields
> of] those records.
>
> Ed.


thanks for the input (not!)
I just decided to count lines instead.
Sorry about the CRLF's. That's google Groups for you.
Nagios is a monitoring service.
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 05:13 PM
Hajo Ehlers
 
Posts: n/a
Default Re: AIX alog pattern match

On Jan 18, 4:28 am, Henry <[email protected]> wrote:
> On Jan 17, 7:19 am, Hajo Ehlers <[email protected]> wrote:
>
> > On Jan 15, 10:46 pm, Henry <[email protected]> wrote:> 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

>
> > ....

>
> > The conslog is normaly not the primary source of error information on
> > AIX. Thus you should take a look at the error log as well as the
> > possiblity to get information directly from the error daemon to a
> > syslog or nagios

>
> > or quick search:http://users.ca.astound.net/baspence...rr_notify2.htm

>
> > hth
> > Hajo

>
> I look through syslog, and the AIX errorlog, but, things do appear on
> the console log too.


IMHO the conslog is NOT desinged as an logging facility. Thus it is
only for information.
This said. Even the error message in your OP should have an entry in
the errlog.

Thus the first point is to look at the error log which will tell you
if you have a hardware , software, permament, ... problem
For people working with syslog or a centralized syslog facility you
can configure the errlog facility to send error messages to the syslog
as well.

hth
Hajo

Reply With Quote
Reply


Thread Tools
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

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



All times are GMT. The time now is 05:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0