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.
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.
| Parameter | Meaning | Example use |
|---|---|---|
| -m QMNAME | Queue manager to trace | strmqtrc -m PROD.QM01 |
| -t n | Trace level (verbosity) | -t 4 moderate detail |
| -b | Backup existing trace files | Avoid overwriting prior capture |
| -l path | Trace file location/prefix | Dedicated incident directory |
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.
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.
1234567# 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
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.
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.
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.
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.
On lab QM, run strmqtrc -m with -t 1 and -t 4 separately; compare file sizes after one connect attempt.
Write strmqtrc line for your standard channel incident template including -b and -l paths.
List who on your team is allowed to run strmqtrc in production.
1. strmqtrc is used to:
2. -m on strmqtrc specifies:
3. After strmqtrc you must plan:
4. High -t levels on a busy QM: