04/06/95 Setting Up Notification of Missing Physical Volumes SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT This document describes how to set up error notification (by console message and mail to root) of missing physical volumes. This is especially useful if a missing physical volume may not be noticed because it is mirrored. This doc- ument applies to AIX 3.2.5 and 4.1. OVERVIEW When a physical volume is declared missing, AIX logs a "LV_SA_PVMISS" error to the error log. However, unless the system administrator is periodically checking the error log, this error can go for some time without being detected. It is especially likely for the missing physical volume to be undetected if it is part of a mirrored volume group and there is still one good copy available to the system. In this situation, the users will not notice anything wrong because there is still one good copy of the data they are accessing. Many system administrators would like to automatically be notified of this type of situation. It is possible to set up automatic error notification to be triggered when the LV_SA_PVMISS error is generated. This document describes steps to add error notification to the ODM and to set up a sample script to perform the type of error notification you would like to have on your system. These steps, if imple- mented as specified below, will send a message to the console and send mail to the root user whenever the LV_SA_PVMISS error is generated. STEPS NOTE: You must be logged in as root to perform these steps. 1. Make a backup copy of the errnotify ODM file: cd /etc/objrepos cp errnotify errnotify.MMDDYY where MMDDYY is the current date. Setting Up Notification of Missing Physical Volumes 1 04/06/95 2. Create a file "/tmp/pvmiss.add" that contains the fol- lowing stanza: errnotify: en_pid = 0 en_name = "LVM_SA_PVMISS" en_persistenceflg = 1 en_label = "LVM_SA_PVMISS" en_crcid = 0 en_class = "H" en_type = "UNKN" en_alertflg = "" en_resource = "LVDD" en_rtype = "NONE" en_rclass = "NONE" en_method = "/usr/lib/ras/pvmiss.notify $1 $2 $3 $4 $5 $6 $7 $8 $9" NOTE: The "en_method" line can be entered exactly as it is shown above. "$1" through "$9" will be auto- matically expanded by the error notification daemon to be the following: $1 The sequence number from the error log entry $2 The error ID from the error log entry $3 The error class from the error log entry $4 The error type from the error log entry $5 The alert flags value from the error log entry $6 The resource name from the error log entry $7 The resource type from the error log entry $8 The resource class from the error log entry $9 The error label from the error log entry. 3. Create the file "/usr/lib/ras/pvmiss.notify" with the following contents: NOTE: Please note that page headers and footers may appear in the following code. They should be removed before the code is used. Also, revision bars (vertical bars in the left margin which mark changes in the docu- ment) may appear to the left of the code and should be removed before the code is used. Setting Up Notification of Missing Physical Volumes 2 04/06/95 #!/bin/ksh exec 3>/dev/console print -u3 "\007" print -u3 - "-------------------------------------------------------------" print -u3 "WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!" print -u3 "" print -u3 "Desc: PHYSICAL VOLUME DECLARED MISSING. PLEASE SEE ERRPT." print -u3 "" print -u3 "Error Label: $9" print -u3 "Sequence number: $1" print -u3 "Error ID: $2" print -u3 "Error Class: $3" print -u3 "Error Type: $4" print -u3 "Resource Name: $6" print -u3 "Resource Type: $7" print -u3 "Resource Class: $8" print -u3 - "-------------------------------------------------------------" print -u3 "\007" mail -s "PHYSICAL VOLUME DECLARED MISSING" root <<-EOF ----------------------------------------------------------------------- WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! Desc: PHYSICAL VOLUME DECLARED MISSING. PLEASE SEE ERRPT. Error Label: $9 Sequence number: $1 Error ID: $2 Error Class: $3 Error Type: $4 Resource Name: $6 Resource Type: $7 Resource Class: $8 ----------------------------------------------------------------------- EOF 4. Set the appropriate permissions on "/usr/lib/ras/pvmiss.notify": chmod 755 /usr/lib/ras/pvmiss.notify 5. Add the errnotify stanza for LVM_SA_PVMISS to the ODM: odmadd /tmp/pvmiss.add The system should now run the /usr/lib/ras/pvmiss.notify script whenever the LVM_SA_PVMISS error occurs. The pvmiss.notify script will send a message to the console and will also send mail to root. This script can be modified to take the specific actions the system administrator would like to invoke when this error occurs. The errnotify ODM file can also be modified to respond to additional error conditions. These modifications would be up to the system administrator. Setting Up Notification of Missing Physical Volumes 3 04/06/95 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (pv.msng.ntfy.325-41.krn) Setting Up Notification of Missing Physical Volumes 4