[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Errpt and syslog

Posted on 2009-05-04
3
Medium Priority
?
1,290 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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 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…
Suggested Courses

649 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