Run OS Commands with MQ Service Object - AMQ8734- Command Failure - Program cannot be started

I want to remotely run a test command on an MQ Server Windows Machine. For this I am using SupportPac MO72 and I can successfully connect remotely to the MQ Server with admin ID. Now I have an MQSC console and I want to run some OS command with object creation SERVICE

. I have defined my service as:

DEFINE SERVICE ('myService') STARTCMD ('C: \ Windows \ System32 \ PING.EXE 127.0.0.1') SERVTYPE (SERVER) CONTROL (MANUAL)

The service was created successfully and now I want to start this service, so I typed:

INITIAL SERVICE (myService)

But I got this error:

AMQ8734- Command Failure - Program could not be started

Any idea?

+3


source to share


1 answer


There is something wrong ...

  • Yours SERVTYPE(SERVER)

    is for something that starts up and keeps running (and therefore whose health is monitored). SERVTYPE(COMMAND)

    is what you start and end. Only monitoring SERVTYPE(SERVER)

    can be controlled for health, but it must be long-term.

  • Yours startcmd

    must be binary to run - just binary. STARTARGS

    you must save the command arguments.

     DEFINE SERVICE('myService') +  
            STARTCMD('C:\Windows\System32\PING.EXE') +  
            STARTARG('127.0.0.1') +  
            SERVTYPE(COMMAND) +  
            CONTROL(MANUAL)  
    
          



Of course, you might like it out - look at how args STDOUT

and STDERR

to display output to a file.

If you want the exit to go back to the remote client in the queue, it gets a little more complicated. You will need to capture the output and pipe it through amqsput

or some other program to get it into the queue and then receive it. The queue cannot be the same reply queue you use with MO72, because MO72 will suffocate the text, so you will need to use amqsgetc

some other program or some other program to fetch the output from the queue.

+4


source







All Articles