Automated Testing

Automated Testing

Automated Testing

Build an automated testing process to enable continuous integration of your hybrid cloud applications including z/OS

 View Only
  • 1.  RD&T automatic shutdown

    Posted Tue November 05, 2013 04:12 AM

    Hi,

    I am trying to develop a Linux script to stop automatically RD&T, for that, the best way to do that is using the command oprmsg and launching my "S SHUTDOWN" z  procedure, stopping correctly this way my z system.

    I am working on Red Hat 6 and RD&T 8.5

    But I need capture the output of this command oprmsg to be sure that the system is correctly stopped before execute awsstop, and I have to problems:

    1) When I execute oprmsg with a command, for example:

           oprmsg 'D A,L'    the result is showed in screen sucessfully, but!, the command is waiting for an user response (one Enter for example).

           Do you now if there are any way to execute the command oprmsg without user response?

     

    2) When I try to redirect the oprmsg output to a file using for example:

           oprmsg 'D A,L' > output.log

        It is not working. Do you know how can I redirect this output to a file?.

     

    Thank you in advance to everybody and regards.

     

     

    SergioDataAdviser


  • 2.  Re: RD&T automatic shutdown

    Posted Tue November 05, 2013 01:13 PM

    The console output goes to a file in ~/z1090/logs.  Although it is a little ugly, especially on an active system, you can grab the output from there.  I think you could get the outstanding replies with D R,L and you'd have to parse it.  Here is an example that does a D A,L and saves the output to a separate file.  It finds the most recent console file and also uses tac which reverses the file and may not be standard (it is on my SUSE system).  There may be much better ways to do these tasks but you'll get the idea.

    #!/bin/sh
    oprmsg "V CN(*),ACTIVATE"  # turn on console cmds
    sleep 1                    # let output go to console
    oprmsg "D A,L"             # display active list
    sleep 1                    # let output go to console
    # search console for  last command and all output since.
    tail -n 200  `ls -t ~/z1090/logs/*con* | head -n 1` \
            |tac |sed -n '1,/^CMD/'p |tac \
             >  consout.txt
    cat consout.txt
    # use grep or other commands here
    rm consout.txt
     

    RDzDoug