strmqtrc

The strmqtrc command starts IBM MQ trace. It is the beginning of a deliberate diagnostic session—not something you run because a queue is deep. Operators who understand strmqtrc choose the queue manager, set an appropriate trace level, optionally scope to a channel or function, record where files will land, reproduce a failure once, and hand formatted output to a colleague or IBM Support. Operators who misunderstand strmqtrc leave trace running over a weekend and trigger a disk outage. This tutorial walks through strmqtrc parameters you will see on Linux and Windows, how -m and -t interact, backup and location options such as -b and -l, planning disk and time, pairing with endmqtrc, and example scenarios for channel bind failures versus API reason codes.

Command Role

strmqtrc tells the queue manager to begin writing trace records. Until trace starts, many internal paths are silent in external logs. Once started, the queue manager logs according to the level and filters you supplied. Trace is separate from AMQERR—AMQERR continues regardless. You can have AMQERR showing AMQ9208 channel errors while strmqtrc captures the state transitions leading to RETRY. Always read AMQERR first; use strmqtrc when you need the movie, not only the headline.

Common strmqtrc parameters (distributed MQ—verify IBM doc)
ParameterMeaningExample use
-m QMNAMEQueue manager to tracestrmqtrc -m PROD.QM01
-t nTrace level (verbosity)-t 4 moderate detail
-bBackup existing trace filesAvoid overwriting prior capture
-l pathTrace file location/prefixDedicated incident directory

Trace Levels (-t)

Level 1 is the lightest extra detail—useful when support asks for a quick look. Levels around 4 are common for channel problems in lab reproductions. Very high levels belong in short windows with IBM guidance—they log enough data to impact performance on busy systems. If you are unsure, start at 4 for fifteen minutes on a test queue manager that mirrors production config, not on production itself. Document the level in your change ticket so the next engineer does not assume a different level was used when reading formatted output.

Scoped Trace

When IBM MQ supports filtering by channel name, function, or process on your platform, use it. A payment channel that fails once per hour should not require tracing the entire queue manager at level 9. Scoped trace shrinks files and speeds grep. If filtering is unavailable for your symptom, reduce duration instead of level first—sometimes a two-minute level-4 capture at peak retry is enough.

Example Sessions

Channel bind failure

shell
1
2
3
4
5
6
7
# 1. Confirm symptom in AMQERR tail -50 /var/mqm/qmgrs/PROD.QM01/errors/AMQERR01.log # 2. Start trace with backup and named location strmqtrc -m PROD.QM01 -t 4 -b -l /var/mqm/trace/incident-chl-20260517 # 3. Ask partner to attempt one connect or wait for one retry cycle # 4. Stop trace (see endmqtrc tutorial) endmqtrc -a

Application MQI failure on server connection

When a bindings or server-connected application gets reason 2035 but AMQERR is vague, strmqtrc at moderate level during a single failed MQPUT may show whether OAM was consulted and which user ID was evaluated. Reproduce with a test program using the same connection handle options as production.

Before You Run strmqtrc

  1. Get approval for production tracing if your policy requires it.
  2. Check df -h on trace and /var/mqm filesystems.
  3. Confirm no other engineer already started trace (duplicate strmqtrc can confuse analysis).
  4. Write the planned end time in the ticket and calendar.
  5. Ensure endmqtrc command is ready in your shell history template.

Platform Notes

Linux and Windows use strmqtrc from the MQ bin directory in the mqm user environment. z/OS may use different trace start procedures (TRACE commands, started tasks)—if you administer z/OS MQ, keep a platform-specific runbook; the concepts match but command names differ. Containerized MQ still needs trace volume mounted with enough ephemeral or persistent storage; tracing inside Kubernetes without volume limits evicts pods.

Explainer: Pressing Record

strmqtrc is the record button on a video camera pointed at the queue manager. You press record, stage the one action you need to see, then press stop (endmqtrc). Leaving record on fills the memory card.

Mistakes to Avoid

  • Starting trace without reproducing—files show normal traffic only.
  • Changing channel definitions mid-trace—confuses before/after analysis.
  • Running strmqtrc on multiple queue managers without staffing to end each trace.
  • Assuming trace replaces AMQERR or FDC—it supplements them.

Explain Like I'm Five: strmqtrc

strmqtrc tells the mail machine to write down every little step it takes. You only say that when you need to watch closely for a minute—not all day.

Practice Exercises

Exercise 1

On lab QM, run strmqtrc -m with -t 1 and -t 4 separately; compare file sizes after one connect attempt.

Exercise 2

Write strmqtrc line for your standard channel incident template including -b and -l paths.

Exercise 3

List who on your team is allowed to run strmqtrc in production.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. strmqtrc is used to:

  • Start MQ trace
  • Start queue manager
  • Define channel
  • Reset FDC

2. -m on strmqtrc specifies:

  • Queue manager name
  • Message size
  • MAXDEPTH
  • MCAUSER

3. After strmqtrc you must plan:

  • endmqtrc and disk space
  • DELETE QMGR
  • Format BSDS only
  • Disable TLS forever

4. High -t levels on a busy QM:

  • Create large trace files quickly
  • Reduce disk use
  • Fix CHLAUTH
  • Empty queues
Published
Read time18 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation