Setting Up Notification of Missing Physical Volumes


Contents

About this document
Overview
Procedure

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 document applies to AIX Version 3.2 and all later versions.


Overview

When a physical volume is declared missing, AIX logs an LV_SA_PVMISS error to the error log. However, unless the system administrator is periodically checking the error log, this error can go undetected for some time. It is especially likely for the missing physical volume to be undetected if it is part of a mirrored volume group. 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 be automatically notified of this type of situation. It is possible to set up triggering of automatic error notification when the LV_SA_PVMISS error is generated. This document describes steps to add error notification to the Object Data Manager (ODM) and to set up a sample script to perform the desired type of error notification. The process implemented by following these steps will send a message to the console and send mail to the root user whenever the LV_SA_PVMISS error is generated.


Procedure

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 
    
    MMDDYY represents the current date.

  2. Create the file /tmp/pvmiss.add that contains the following 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 automatically 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 contents indicated below.

    NOTE: Page headers and footers may appear in the following code. Remove them before using the code. Also, revision bars (vertical bars in the left margin which mark changes in the document) may appear to the left of the code and should be removed before the code is used.

    #!/bin/ksh 
    exec 3>/dev/console 
    print -u3 "?" 
    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 "?"
    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. Enter:
       chmod 755 /usr/lib/ras/pvmiss.notify 
    
  5. Add the errnotify stanza for LVM_SA_PVMISS to the ODM. Enter:
       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. The system administrator can modify this script to take the specific actions desired when this error occurs. The system administrator can also modify the errnotify ODM file to respond to additional error conditions.




[ Doc Ref: 90605220314842     Publish Date: Oct. 19, 2000     4FAX Ref: 7440 ]