ADSM-L

Re[2]: adsm server external tape mount trap

1997-07-19 06:59:46
Subject: Re[2]: adsm server external tape mount trap
From: Larry Robertson <Larry_Robertson AT COMPUWARE DOT COM>
Date: Sat, 19 Jul 1997 05:59:46 EST
Note this is a resent of my earlier reply to steve. When I cut and pasted the
code into the original e:mail some of the characters didn't translate correctly.

Larry




Hi Steve,
I have the same environment here and found the same need to integrate ADSM on
the RS/6000 with MVS. I not only echo tape mount messages on the MVS console but
also information / critical event notification. Although the RS/6000 console is
near the MVS console, the operators normally don't have a need to look at it so
they would miss important messages. Now I can put highlited, non scrollable
messages on the console that they are always looking at. I also use the same
mechanism to send messages to TSO id's.
This is accomplished using a poor mans SNMP trap process as follows: (Code will
follow)
1. As Murray discribed, I have a console session that runs on AIX and pipes the
output to a script where the messages are filtered. (I'm sure there must be a
better way to parse the messages. I would appreciate any suggestions).
2. When I trap the tape mount message I build the message(s) to be displayed on
MVS, put them into a file, and then execute a script to send them. This script
has 2 steps. The first step FTP's the message file to MVS and the second step
uses REXEC to logon to MVS and execute a REXX EXEC which the reads the message
file, and sends it to the MVS console where AOC then traps it and highlites it.
The first field of each message contains the ID of where to send the message.
CONSOLE = MVS console
xxxxxxx = A valid TSOID
This allows me to send the message(s) to multiple places.
Because of the required MVS logon, the whole process takes about 20 seconds. I
would be interested in the script / process that you have developed to send the
messages. I would like to use SNMP to send a trap to MVS/NETVIEW but I think
that I need NETVIEW/6000 to get the trap support on AIX. Does anyone know if
this is true?

I use this same process for other integration tasks where I send data to MVS,
then logon and execute an EXEC to process the data. For instance when the
database backup runs (with scratch=yes) it will call for a mount of DBBK.1
I have initialized a series of 3490 tapes as ADxxxx to be used for this purpose
but the operator has no way of knowing which ones are available for the backup.
So at the end of the backup I FTP a list of all used ADxxxx tapes to MVS. When
the next days database backup starts, the script controlling the process first
logs on to MVS and executes an EXEC to read the list of used tapes, and based on
the known range of tapes determines which ones are not used and available for
the backup. It then executes the following commands to send a list of up to 5
available volumes to the MVS console.
 "SEND 'ADSM01- ELIGIBLE VOLUMES FOR ADSM DBBK.1:
                                          ' CN(01)"
 "SEND 'ADSM01- "V.1 V.2 V.3 V.4 V.5 "-
                             ' CN(01)"
After this completes the database backup is started and when the mount for
DBBK.1 is trapped and echoed on the MVS console they already have a list of 5
tapes to choose from.

I would like to hear about other integration ideas.

Larry Robertson
Enterprise Storage Management Specialist
248 737-7300
larry_robertson AT compuware DOT com


Here is my ADSM console monitor code:

#!/bin/sh
# console-mon-script:
# This script is started by .profile and is designed to run
# continuously to monitor the ADSM console for important messages.
# These messages will be sent to the MVS operator console.
#
# All other messages can be accumulated and saved in the 'message'
# directory. (Normally commented out)
#
#
# Give ADSM time (5 minutes) to start after the RS/6000 is re-booted.
#
sleep 300
#
# Start an ADSM console session and pipe the output to this script.
#
dsmadmc -cons -id=admin -pass=xxx |&
#
# Initial output of console session is junk. It will be saved in the
# 'TRASH' file.
#
LINEOUT=TRASH
read -p LINEIN
while [ $? -eq 0 ] ; do
# Find the start of an ADSM message
  echo $LINEIN | grep ^AN[R,S][0-9][0-9][0-9][0-9][I,W,K,E,S,D] \
  1>/dev/null 2>&1
  if [ $? -eq 0 ] ; then                # found first line of a message
# Write the last message to message archive
    MSGID=$( echo $LINEOUT | cut -d" " -f1 )
    if [ "$MSGID" = "ANR8326I" ]        # check for tape mount msg
    then
      MSGVAR06=$( echo $LINEOUT | cut -d" " -f06 )  # parse message
      MSGVAR10=$( echo $LINEOUT | cut -d" " -f10 )  # parse message
      MSGVAR16=$( echo $LINEOUT | cut -d" " -f16 )  # parse message
      echo $MSGVAR06                   # Volser
      echo $MSGVAR10                   # Drive
      echo $MSGVAR16                   # Time
      if [ "$MSGVAR16" = "60" ]        # check for 1st tape mount msg
      then
# Display the mount message on the MVS operator console.
        MVSMSG='Mount '$MSGVAR06' on '$MSGVAR10' '
        echo "Display tape mount message on MVS operator console"
        echo "CONSOLE ADSM01- $MVSMSG" > rexec-message-file
        echo "CONSOLE ADSM01- $MVSMSG"
        /home/adsmcon/mvsmsg-script
      fi
    fi
# store in message file
#    echo $(date +%a_%D_%H:%M:%S) $LINEOUT \
#    >> /home/adsmcon/messages/$MSGID
# Save the new message line.
    LINEOUT=$LINEIN
  else
# Re-assemble multi-line messages.
    LINEOUT=$LINEOUT' '$LINEIN          # tack on next line of msg
  fi
  read -p LINEIN
done

______________________________ Reply Separator _________________________________
Subject: Re: adsm server external tape mount trap
Author:  "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> at 
CWUS-Internet
Date:    7/18/97 7:58 AM


Caution!  The following is untested, speculative and personal opinion!

On an NT system (and any other I suspect) it is possible to run the
"DSMADMC.EXE -consolemode" command.  This results in a window which receive
many, and particularly tape mount, messages.  If you truly only want tape
mount messages use the "-mount" flag instead of "-consolemode".  Most, if
not all, commands can have their output redirected to a file or piped to
another program (e.g., DSMADMC.EXE -consolemode >
/usr/tmp/adsmconsole.log).

On an AIX system, such output could be monitored via the "tail -f" command
and further piped into an awk or sed script to trap the messages you want.
 If the dsmadmc command is actually running on an appropriate machine, you
could probably pipe its output directly to the awk/sed script.  What you do
with the selected messages when you trap them is up to you.

At Haltek we actually market, commercially, our own MVS to AIX or NT file
transfer program (over SNA connections) which does support user exits
triggered on completion of the transfer.  I have never considered using it
in this way and am not sure whether you could apply it to this situation.
 Of course, if you have a full MVS TCP/IP suite with appropriate LAN
connections you can probably use SMTP routines on MVS to receive messages
and convert them into WTORs.

Good luck, and let us all know how you go.

Murray Nicholas
Systems Specialist
HALTEK PTY LTD
<Prev in Thread] Current Thread [Next in Thread>