• 1 reply
  • Latest Post - ‏2013-11-05T18:13:15Z by RDzDoug
17 Posts

Pinned topic RD&T automatic shutdown

‏2013-11-05T09:11:45Z | automatic rd&t shutdown


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.



  • RDzDoug
    5 Posts

    Re: RD&T automatic shutdown


    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.

    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

    Updated on 2013-11-05T18:20:43Z at 2013-11-05T18:20:43Z by RDzDoug