[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1301
  • Last Modified:

Errpt and syslog

How do I configure for the errpt errors sent to syslog.
0
vishwakarmak
Asked:
vishwakarmak
  • 2
1 Solution
 
woolmilkporcCommented:
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
 
vishwakarmakAuthor Commented:
That explains a lot also can you please help me with the script, would be great
0
 
woolmilkporcCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now