Page 1 of 5
Verifying that an IBM MQ Listener runmqlsr is running in Windows and Linux
https://www.ibm.com/support/pages/node/7028389
Date last updated: 22-Jun-2024
Angel Rivera
IBM MQ Support
https://www.ibm.com/products/mq/support
Find all the support you need for IBM MQ
+++ Question +++
You want to know if the MQ Listener process "runmqlsr" is running for an IBM MQ queue
manager in Windows and Linux in a local host. That is, you are logged in in host-1 and you
want to know if there is an MQ listener running in host-1.
However, for a related scenario, if you are in host-2 and you want to know if there is an MQ
listener in another host (host-1), then the following technote can be helpful:
https://www.ibm.com/support/pages/node/482611
Using ssh to test connectivity between an IBM MQ Client in one host and
a Queue Manager in another host
+ Tags: netstat, Task Manager
+++ Answer +++
++ General
In this example, the MQ listener object "LISTENER" is running in port "1414".
Use "runmqsc" to display the Listeners and their Status.
$ runmqsc QMGR1
display listener(*) all
AMQ8630I: Display listener information details.
LISTENER(SYSTEM.DEFAULT.LISTENER.TCP) CONTROL(MANUAL)
TRPTYPE(TCP) PORT(0)
AMQ8630I: Display listener information details.
LISTENER(LISTENER) CONTROL(QMGR)
TRPTYPE(TCP) PORT(1414)
display lsstatus(*) port
AMQ8631I: Display listener status details.
LISTENER(LISTENER) STATUS(RUNNING)
PID(43735) PORT(1414)
Page 2 of 5
++ Linux
In this example, there are 2 queue managers, each one with its own Listener port.
When the MQ queue manager is running, the listener runs under the process name:
runmqlsr
+ Using ps -ef
Thus you need to query the running processes, and grep for: runmqlsr
$ ps -ef | grep runmqlsr
mqm 15025 14889 0 Aug16 ? 00:00:14 /opt/mqm/bin/runmqlsr -r -m QM93LNX -t TCP -p 1415
mqm 43735 43111 0 10:41 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m QM1 -t TCP -p 1414
You can also use the utility "netstat" as follows, to see if the port used by the Listener (such
as 1414) is active and in "LISTEN" mode.
+ Using netstat
The Unix command "netstat" can be used with the following options:
-a show all
-n show the number that is mentioned in the file /etc/services
That is, do not try to replace it with the name of the service
-p show process id and process name
[email protected]: /home/mqm
$ netstat -anp | grep 1414
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1414 :::* LISTEN 43735/runmqlsr
Page 3 of 5
++ Windows
+ Using line command
Note: Thanks to Bob Gibson for his valuable feedback in providing this variation!
C:\> tasklist | find "runmqlsr"
runmqlsr.exe 24176 Services 0 9,772 K
C:\> tasklist -v | find "runmqlsr"
runmqlsr.exe 24176 Services 0 9,748 K Unknown
ARTURITO\MUSR_MQADMIN 0:00:00 N/A
+ Using Task Manager
You can use the Task Manager as follows.
You will need to add the extra column for "Command line" in order to see the details.
Launch Task Manager:
Identify Process: runmqlsr
Page 4 of 5
Right click the Process and click "Goto Process Details"
Right click on any column and select "Show Columns" and then check "Command Line"
option > Click OK.
Select the desired process, such as runmqlsr.exe and see the text in the column "Command
line":
In this case the value under "Command line" is:
"C:\Program Files\IBM\MQ\bin64\runmqlsr.exe" -r -m QM93WIN -t TCP -p 1414
Page 5 of 5
+ Using netstat
The options for netstat are:
-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or listening port.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
a) The following command shows one line per port, which is easy to parse:
C:\> netstat -ano | findstr 1414
TCP 0.0.0.0:1414 0.0.0.0:0 LISTENING 27512
TCP [::]:1414 [::]:0 LISTENING 27512
b) The following command uses the -b option, but unfortunately the output uses several
lines for each port, which makes it harder to parse.
You may not have C:\temp, thus, capture the output into a temporary directory:
C:\> netstat -anob > c:\temp\netstat-out.txt
C:\> notepad c:\temp\netstat-out.txt
In the output file, search for the port number "1414" ensure that the process that is using it
is: runmqlsr.exe.
The following is a real example (note that it is shown in 2 physical lines in the output file)
TCP 0.0.0.0:1414 0.0.0.0:0 LISTENING 27512
[runmqlsr.exe]
+++ end +++