Solved

Errpt and syslog

Posted on 2009-05-04
3
1,271 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
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…

726 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