Solved

Errpt and syslog

Posted on 2009-05-04
3
1,241 Views
Last Modified: 2013-11-17
How do I configure for the errpt errors sent to syslog.
0
Comment
Question by:vishwakarmak
  • 2
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 24296115
Hello again,
you can accomplish this by means of the concurrent error notify facility and the 'logger' command.
Create a file with the following content -

errnotify:
en_name = "syslog1"
en_persistenceflg = 1
en_method = "logger Msg from Error Log: $(errpt -l $1 | grep -v 'TIMESTAMP')"  
Name the file e.g. /tmp/errnotify.add and issue
odmadd  /tmp/errnotify.add
This way you will get all errpt entries (the short version, as obtained by 'errpt' without parameter) into syslog (user.notice)
You can configure a facility.level combination other than user.notice by using 'logger -p facility.level ...'  in the above entry instead of 'logger ...' alone.
There are more descriptors than just 'en_persistenceflg', and there are also more positional parameters than just $1 (which is the error sequence number).

$1 Sequence number from the error log entry
$2 Error ID from the error log entry
$3 Class from the error log entry
$4 Type from the error log entry
$5 Alert flags value from the error log entry
$6 Resource name from the error log entry
$7 Resource type from the error log entry
$8 Resource class from the error log entry
$9 Error label from the error log entry  
To exploit them in full, write a script which calls logger accordingly, and give path/name of that script as en_method.
I could help you with that, if you wish.
Good luck!
Cheers
wmp
 
0
 

Author Comment

by:vishwakarmak
ID: 24296365
That explains a lot also can you please help me with the script, would be great
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24302441
Hi again,
basically, you define en_method as a script of your own passing it some or all of the positional parameters -
en_method = "/path/to/my/script $1 $2 $3 $4 $5 $6 $7 $8 $9"
Your script can then use the suppled values at wish, e.g. react differently according to error classes ($3, can be  (H)ardware or (S)oftware), or to resources (tapes, disks ...  / rmt0, hdisk0 ...). One could also think of different reactions based on type ($4, e.g. INFO, PERM, TEMP, PERF, PEND ...).
Note that you can issue 'errpt -a -l $1' in your script, so you get the complete errpt entry and can parse it for additional info. Type 'errpt -a | more' to see what's interesting in there.
Instead of making selections in the script, you could also define several ODM errnotify entries, based on descriptors (basically the same as the parameters above, e.g. en_class, en_resource, en_rclass...) e.g.

errnotify:
en_name = "syslogH"
en_class = "H"
en_persistenceflg = 1
en_method = "/script/to/deal/with/hardware/errors"  
... or use logger as in the first suggestion and give it different facility.level settings, e.g.

errnotify:
en_name = "xxxx"
en_type = "PEND"
en_method = "logger -p local0.crit .............. "

errnotify:
en_name = " yyyy"
en_type = "TEMP"
en_method = "logger -p local1.info .............. "

We use the first method above (passing all parameters to the script) to send snmp traps to nagios.
HTH
wmp
 
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now