?
Solved

Errpt and syslog

Posted on 2009-05-04
3
Medium Priority
?
1,281 Views
Last Modified: 2013-11-17
How do I configure for the errpt errors sent to syslog.
0
Comment
Question by:vishwakarmak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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