The imqcmd utility enables you to manage the broker and its services.
Reference information about the syntax, subcommands, and options of the imqcmd command is in Chapter 13, Command Line Reference. Reference information for managing physical destinations is in a separate chapter, Chapter 15, Physical Destination Property Reference.
To display help on the imqcmd utility, use the -h or -H option, and do not use a subcommand. You cannot get help about specific subcommands.
For example, the following command displays help about imqcmd:
If you enter a command line that contains the -h or -H option in addition to a subcommand or other options, the imqcmd utility processes only the -h or -H option. All other items on the command line are ignored.
To display the Message Queue product version, use the -v option. For example:
If you enter a command line that contains the -v option in addition to a subcommand or other options, the imqcmd utility processes only the -v option. All other items on the command line are ignored.
Because each imqcmd subcommand is authenticated against the user repository, it requires a user name and password. The only exceptions are commands that use the -h or -H option to display help, and commands that use the -v option to display the product version.
Use the -u option to specify an administrative user name. If you omit the user name, the command prompts you for it. For example, the following command displays information about the default broker:
imqcmd query bkr -u admin
To make the examples in this chapter easy to read, the default user name admin is shown as the argument to the -u option. In a production environment, you would use a custom user name.
Specify the password using one of the following methods:
Create a password file (passfile) and enter the password into that file. On the command line, use the -passfile option to provide the name of the password file.
Let the command prompt you for the password.
In previous versions of Message Queue, you could use the -p option to specify a password on the imqcmd command line. This option is being deprecated and will be removed in a future version.
The default broker for imqcmd is one that is running on the local host, and the default port is 7676.
If you are issuing a command to a broker running on a remote host or listening on a nondefault port, or both, you must use the -b option to specify the broker’s host and port.
The examples in this section illustrate how to use imqcmd.
The first example lists the properties of the broker running on localhost at port 7676, so the -b option is unnecessary. The command uses the default administrative user name (admin ) and omits the password, so that the command prompts for it.
imqcmd query bkr -u admin
The following example lists the properties of the broker running on the host myserver at port 1564. The user name is aladdin . (For this command to work, the user repository would need to be updated to add the user name aladdin to the admin group.)
imqcmd query bkr -b myserver:1564 -u aladdin
The following example lists the properties of the broker running on localhost at port 7676. The initial timeout for the command is set to 20 seconds and the number of retries after timeout is set to 7. The user’s password is in a password file called myPassfile, located in the current directory at the time the command is invoked.
imqcmd query bkr -u admin -passfile myPassfile -rtm 20 -rtr 7
For a secure connection to the broker, these examples could include the -secure option. The -secure option causes imqcmd to use the ssladmin service if the service has been configured and started.