Cruising The Events Registry

If you've ever experienced a fault diagnosed by FMA, you've likely visited http://sun.com/msg to look at any additional detail associated with the fault. The Event Registry is the home for all of that content. The registry was made an OpenSolaris project a while back. The project page describes the content and structure well, but for this blog I thought I'd take a look at how a sysadmin or customer might use it.

Assuming you've downloaded and unpacked the Events Registry, the first thing I'd expect folks to try is the web-based front end. To launch, we use the tools/bin/erapache script:

% tools/bin/erapache 9898 Running apache on port 9898. Error log, lock files, etc. will be in /tmp/erapache.9898 Apached started, pid 1818

The registry download comes with everything you need to run a self-contained Apache web server on the port you designate. So the interface is OK. You can poke around the events and articles. A portion of the message codes in the AMD dictionary is at right. But, unless you're digging into the depths of an ereport and want the gory details on each payload member, you'll probably get bored pretty quick.

Turning to the command line tools, ermsg is an interesting gem. As the documentation states in docs/ermsg.html, this tool displays event registry messages - the message codes, articles, and so forth. It's got several options that make it very handy for carving up the registry. Running without arguments lists all of the dictionaries (the top level collections of message codes and knowledge articles) in the registry:

% tools/bin/ermsg Dictionaries: AMD DISK FMD GMCA INTEL IOXSCF NXGE ...

Run the tool against a specific dictionary, and you'll get a list of all the possible FMA message codes that can result:

% tools/bin/ermsg -d DISK ermsg: workspace "/export/home/XXX/sun/fm/event-reg/tools/bin/../.." ermsg: namespace "FMA" Dictionary: DISK has 3 entries Dictionary Entry No. ID DISK 0 DISK-8000-0X DISK 1 DISK-8000-12 DISK 2 DISK-8000-2J

Now this starts to get interesting. By mining the event registry with ermsg, you can pull out any message code FMA might ever emit. And furthermore, you can glean the severity level of the event as well:

% tools/bin/ermsg DISK-8000-0X Dictionary Entry No. ID DISK 0 DISK-8000-0X Properties: keys: fault.io.disk.predictive-failure type: fault severity: major

Using this information, a quick and dirty monitoring script can be written to notify me of any FMA diagnoses deemed of interest. The following can be used to get an event code to severity table:

#!/bin/sh ERMSG="tools/bin/ermsg" for dict in `$ERMSG | grep -v Dictionaries`; do for code in `$ERMSG -d $dict | grep -v Dictionary | grep -v ermsg | \\ awk '{print $3}'`; do SEV=`$ERMSG $code 2>/dev/null | grep severity | \\ awk '{print $2}' | tr [A-Z] [a-z]` echo "$code\\t$SEV" done done

With the resulting table, you can easily pick out 'critical' events. Or 'major'. Wrap your list of events around a periodic fmdump command, and notifications can be sent when one of those events occurs. Poor man's monitoring.

Of course, it'd be better to leverage snmp-trapgen agent that's snapped into FMD. There's a good blog on that here. It's a better overall management framework, and you don't need to be concerned with periodically updating your event registry copy to pick up new message codes. But in a pinch, or if you're just trying out OpenSolaris in your shop, this may do.

Lastly a request: you can help improve the content. If the details of an article are vague or incomplete (and yes, some are), Localization to languages beyond English would be nice. Bring your comments and questions to fm-discuss@opensolaris.org. Or (dread the thought) your system suffers a fault, use the comments form at the bottom of the http://sun.com/msg article and tell Sun what needs to be improved.

:wq

Comments:

Post a Comment:
Comments are closed for this entry.
About

user9148476

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today