HP OpenVMS Systems

ask the wizard
Content starts here

SYSMAN, PIPE, and DCL?

» close window

The Question is:

 
I have a 3-node cluster. On to two separate nodes there is 1 SCSI-attached
 TL895 jukebox. I want to write a piece of code that allows me to issue the
 "robot find cartridge" command on jukebox number 2 if it can't find it on
 jukebox no.1 thus relieving me
of the need to log on to the other node or invoke SYSMAN interactively.
 Currently my code interrogates the first jukebox and then being unable to find
 the volume required interrogates the second thus:
 
$       pipe  ( say "do robot find cartridge ''tapeno' robot gka0") | mcr
 sysman set env/node=paxpv3
 
Whilst this executes the command under SYSMAN my procedure cannot determine
 whether the result was succesful or not. Is there any way I can pass or define
 the status code (succesful or otherwise) using PIPE by way of SYSMAN back to
 the procedure whereupon
 I would issue output dependent on the result?
 


The Answer is :

 
    SYSMAN doesn't return the status of the command because a single DO
    command can potentially execute on all other nodes in a cluster.
    However, the OUTPUT of the SYSMAN command is displayed, so, assuming
    there is some kind of characteristic text in the output of the robot
    command, you can use a further PIPE and SEARCH command to determine the
    status and return the result. So, for example, let's assume that if the
    command fails there will be a message containing the string "%ROBOT-E-"
    in the command output:
 
      $ pipe  ( say "do robot find cartridge ''tapeno' robot gka0") | -
    	   mcr sysman set env/node=paxpv3 | -
    	   SEARCH SYS$INPUT "%ROBOT-E-" ; DEFINE/JOB/NOLOG PIPESTAT &$STATUS
 
    At the completion of the PIPE command, the JOB logical name PIPESTAT
    will contain the $STATUS text from the SEARCH command. (success means
    the robot command failed - watch your logic!) By choosing appropriate
    strings and /MATCH criteria in the SEARCH command, you should be able
    to find a means for determining the results of your ROBOT command.
 
    Note that if you need more control over this operation, you could
    replace the ROBOT FIND command with a command procedure on PAXPV3
    which determines the results of the comand and sends back a specific
    message. For example:
 
    ROBOT_FIND.COM	(on PAXPV3)
 
    $ ROBOT FIND CARTRIDGE 'p1' 'p2' 'p3'
    $ IF $STATUS
    $ THEN
    $   WRITE SYS$OUTPUT "ROBOT_FIND_SUCCESSFUL"
    $ ELSE
    $   WRITE SYS$OUTPUT "ROBOT_FIND_FAILED"
    $ ENDIF
    $ EXIT
 
       $ pipe  ( say "do @ROBOT_FIND ''tapeno' robot gka0") | -
    	   mcr sysman set env/node=paxpv3 | -
    	   SEARCH SYS$INPUT "ROBOT_FIND_SUCCESSFUL" ; -
    		DEFINE/JOB/NOLOG PIPESTAT &$STATUS
 
 

answer written or last revised on ( 14-DEC-2000 )

» close window