Issuing MQSC commands on a remote queue manager

You can use a particular form of the runmqsc command to run MQSC commands on a remote queue manager.

The command server must be running on the target queue manager, if it is going to process MQSC commands remotely. (This is not necessary on the source queue manager). For information on how to start the command server on a queue manager, see Managing the command server for remote administration.

On the source queue manager, you can then run MQSC commands interactively in indirect mode by typing:

runmqsc -w 30 target.queue.manager

This form of the runmqsc command, with the -w flag, runs the MQSC commands in indirect mode, where commands are put (in a modified form) on the command server input queue and executed in order.

When you type in an MQSC command, it is redirected to the remote queue manager, in this case, target.queue.manager. The timeout is set to 30 seconds; if a reply is not received within 30 seconds, the following message is generated on the local (source) queue manager:

AMQ8416: MQSC timed out waiting for a response from the command server.

When you stop issuing MQSC commands, the local queue manager displays any timed-out responses that have arrived and discards any further responses.

The source queue manager defaults to the default local queue manager. If you specify the -m LocalQmgrName option in the runmqsc command, you can direct the commands to be issued by way of any local queue manager.

In indirect mode, you can also run an MQSC command file on a remote queue manager. For example:

runmqsc -w 60 target.queue.manager < mycomds.in > report.out

where mycomds.in is a file containing MQSC commands and report.out is the report file.

Suggested method for issuing commands remotely

When you are issuing commands on a remote queue manager, consider using the following approach:
  1. Put the MQSC commands to be run on the remote system in a command file.
  2. Verify your MQSC commands locally, by specifying the -v flag on the runmqsc command.

    You cannot use runmqsc to verify MQSC commands on another queue manager.

  3. Check that the command file runs locally without error.
  4. Run the command file on the remote system.

If you have problems using MQSC commands remotely

If you have difficulty in running MQSC commands remotely, make sure that you have:
  • Started the command server on the target queue manager.
  • Defined a valid transmission queue.
  • Defined the two ends of the message channels for both:
    • The channel along which the commands are being sent.
    • The channel along which the replies are to be returned.
  • Specified the correct connection name (CONNAME) in the channel definition.
  • Started the listeners before you started the message channels.
  • Checked that the disconnect interval has not expired, for example, if a channel started but then shut down after some time. This is especially important if you start the channels manually.
  • Sent requests from a source queue manager that do not make sense to the target queue manager (for example, requests that include parameters that are not supported on the remote queue manager).

See also Resolving problems with MQSC commands.