Batch job to stop WebSphere MQ trace when an FDC occurs

Technote (troubleshooting)


Problem(Abstract)

FDCs occur in WebSphere MQ for Windows. To investigate the problem further, you need MQ trace. The problem is intermittent and unpredictable. You need a job to stop trace when a specific probe id or an error message occurs, similar to mqtrap or trapit scripts for UNIX systems

Resolving the problem

Beginning in WMQ V7.0 the strmqtrc command has parameters to trigger the starting and stopping of a trace. The '-b --StartTrigger-' and '- -c --StopTrigger-' parameters on strmqtrc are the recommended way of stopping a trace when a specific probe id occurs in WMQ V7.0 and above.

Prior to WMQ V7.0 you can create a batch file similar to the one given below. This will stop the trace when a FDC with a particular probe id or an error message written to the error log occurs.

Notes:

  1. In the example below, the batch job is looking for probe id ZL075030, but you can change this to any probe id. Remember to clear all existing FDC files before activating the job or it will detect the existing probe id and trigger immediately.
  2. You may need to change the directory where the job is looking for the FDC file, if you have installed MQ in a different directory.
  3. The example below includes a "sleep 1" statement to help reduce the overhead. You may need to remove it if your system does not include the sleep command.
  4. The example below may also be modified to look for an AMQ error message, such as AMQ9202. You will need to change the directory where the job is looking for the error message, for example: set FILE=C\Program Files\IBM\WebSphere MQ\Qmgrs\qmgrname\errors\AMQERR*.log
  5. You will also need to modify the 'findstr' variable so that it will know which error message. For example: findstr /C: "AMQ9202" "%FILE%"
  6. Remember to clear all existing error log files before activating the job or it will detect an existing message and trigger immediately.


---------------------------------------------------------
rem *************************
rem Wait for ZL075030 - FFST
rem *************************
rem
set FILE=C:\Program Files\IBM\WebSphere MQ\Errors\*.FDC
rem
rem Loop waiting for the FDC
rem
:start
sleep 1
if exist "%FILE%" goto found
goto start
rem
:found
findstr /C:"ZL075030" "%FILE%"
if errorlevel 1 goto start
:complete
echo Stopping the trace
endmqtrc

Product Alias/Synonym

WebSphere MQ
WMQ
MQSeries

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere MQ
Problem Determination

Software version:

5.3, 6.0, 6.0.2, 7.0, 7.0.1, 7.1, 7.5

Operating system(s):

Windows

Reference #:

1193147

Modified date:

2013-01-14

Translate my page

Machine Translation

Content navigation