NAME
- rmscript - Array event notification script
SYNOPSIS
-
rmscript
DESCRIPTION
-
rmscript is the script called by the notification routines in the arraymon monitor and the parityck application. Those executables will create a file that contains an event record (see the RAID Manager Event Record Format), and call this script with the filename as the first argument to this script.
EXAMPLES
- There are all sorts of possibilities for notification using this script, all of which consist of decoding the event file and generating a message to be sent to some other application. For example, to send the event to the RAID Manager proprietary log, the following line is used:
- putplog $1
- To add parity and AEN events to the system log ( /var/adm/messages ):
- EVTYPE=`cut -d\~ -f6 $1`
- (case $EVTYPE in
- #
- # An AEN event
- #
- 00) awk -F\~ 'NF > 0 { printf "AEN event Host=%s Ctrl=%s Dev=%s\n ASC=%s ASCQ=%s FRU=%s LUN=%s LUN Stat=%s\n Sense=%s", $1, $2, $3, substr($7,1,2), substr($7,3,2), $8, $9, $10, $11 }' < $1 ;;
- #
- # Mode Page events are ignored for now
- #
- 10) ;;
- #
- # Parity event
- #
- 20) awk -F\~ 'NF > 0 { printf "Parity event Host=%s Ctrl=%s Dev=%s\n Start Blk=%s End Blk=%s # Blks=%s LUN=%s ", $1, $2, $3, $7, $8, $9, $10 }' < $1 ;; #
- # Text events are ignored for now
- #
- 90) ;;
- esac) | logger -t rm5 -p user.err
- The preceding example does not deal with mode page and text events. Note that a variety of tools can be used for decoding the event file, including cut(1), awk(1), and sed(1).
- One final example, to mail the superuser that some event has occurred:
- (awk -F\~ 'NF > 0 { printf "rm5 has detected an array event on Controller %s \n Device %s at Host %s - Time %s %s\n", $2, $3, $1, $4, $5 }' < $1;
- echo "\nCheck the event viewer for more details" ) | mailx -s "RAID Manager Event" root
NOTES
-
rmscript should be placed in the directory specified by the System_RmHomeDirectory parameter found in the params file.
- If an application is executed from the script without a full path specified, the script expects that application to be in one of the directories specified in the PATH environment variable, or in the directory specified by the System_RmHomeDirectory parameter found in the rmparams file.
- It is the responsibility of rmscript to delete the event file once it has processed the file. The last statement in the script should be
- rm $1
SEE ALSO
-
arraymon(1M), lad(1M), nvutil(1M), parityck(1M), raidutil(1M), rdac(7), rdacutil(1M), rdaemon(1M), rdriver(4), rm6(1M), rmevent(4), rmparams(4)
|