Batch job to stop WebSphere MQ trace when an FDC occurs
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.
- 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.
- 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.
- 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.
- 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
- You will also need to modify the 'findstr' variable so that it will know which error message. For example: findstr /C: "AMQ9202" "%FILE%"
- Remember to clear all existing error log files before activating the job or it will detect an existing message and trigger immediately.
rem Wait for ZL075030 - FFST
set FILE=C:\Program Files\IBM\WebSphere MQ\Errors\*.FDC
rem Loop waiting for the FDC
if exist "%FILE%" goto found
findstr /C:"ZL075030" "%FILE%"
if errorlevel 1 goto start
echo Stopping the trace
More support for:
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: 14 January 2013