cinnamon -- an errnotify object method that translates the sense data posted to the AIX error log by an IBM 3590 tape drive (a SIM or a MIM) into a readable format, and mails it to a specified address
cinnamon (so named because I thought it sounded like ``sim-mim-mon'', my original name for the program) parses and mails AIX error log entries posted with the identifier D1A1AE6F, which is the ERROR ID for SIM_MIM_RECORD_3590.
SIM and MIM records are part of the ``Statistical Analysis and Reporting System'' (SARS), and are messages created by IBM 3590 tape drives that report on the condition of the drive (a SIM) or of the medium (a MIM). These records are presented by the operating system in different ways. In AIX, SIMs and MIMs are recorded in the error log, the actual information encoded into a 144 character hexadecimal string.
There are three user-definable values that can be set at the beginning of this script. If they are not defined, default values will be used, as described below.
The variable $recipient may be set to one or more e-mail addresses to which the output of this script will be mailed. Any ``@'' signs in the string MUST be back-slash protected; multiple addresses should be separated by commas, with all addresses inside a single set of double-quotes.
If this variable is not set, the output of the script will be mailed to ``root''.
The variable $min_sim_sev defines the lowest severity level of SIM messages that will be parsed and mailed. The severity level for SIMs range from ``4'' (a ``Service'' type message, the lowest severity) to ``1'' (an ``Acute'' problem, probably resulting from hardware failure.) To have the script parse and mail only SIMs with a severity of ``1'' or ``2'', define $min_sim_sev to ``2''.
If this variable is not set, SIMs of all severity levels will be parsed and mailed.
The variable $min_mim_sev defines the lowest severity level of MIM messages that will be parsed and mailed. The severity level for MIMs range from ``3'' (a ``Moderate'', temporary error) to ``1'' (an ``Acute'' problem, resulting from tape directory errors.) To have the script parse and mail only MIMs with a severity of ``1'' or ``2'', define $min_mim_sev to ``2''.
If this variable is not set, MIMs of all severity levels will be parsed and mailed.
This program is designed to be used as an errnotify method added to the ODM, so that it will be invoked by the system each time an errpt entry is logged that matches the descriptor values of a 3590 SIM or MIM message.
To create the errnotify method, save the following text to the file /tmp/cinnamon.add:
errnotify:
en_name = "cinnamon"
en_persistenceflg = 1
en_label = "SIM_MIM_RECORD_3590"
en_class = "H"
en_type = "INFO"
en_method = "/usr/local/bin/perl /usr/local/sbin/cinnamon $1"
(Note: use the proper paths to your perl executable and to this program in the above "en_method" line.)
After saving the above text, run the command:
odmadd /tmp/cinnamon.add
The error notification object will be added to the ODM. To verify that the object was added to the ODM properly, run the command:
odmget -q "en_name='cinnamon'" errnotify
To remove the object from the ODM (why would you want to do that?), run the command:
odmdelete -q "en_name='cinnamon'" -o errnotify
=head1 AUTHOR
Sandor W. Sklar
Unix Systems Administrator
Stanford University ITSS-CSS
<mailto:ssklar@stanford.edu>
<http://whippet.stanford.edu/~ssklar/>
If this script is useful to you, or even if it is of no use to you, or you have some changes/improvements/questions/extra money, please send me an email.
=head1 FOR MORE INFORMATION
Most of the parsing that this script does was derived from the IBM publication ``Statistical Analysis and Reporting System User Guide'', which can be downloaded from <http://www.storage.ibm.com/hardsoft/tape/pubs/pubs3590.html>.
Information about creating custom error notification objects can be found in Chapter 4 of the IBM manual ``General Programming Concepts: Writing and Debugging Programs'', available online at <http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/error_notice.htm>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.