How to Enable Tracing in Service Manager

Author by Christopher Mank

In the wonderful world of technology, I find myself spending most of my time doing one of two things:  Engineering really cool things, or fixing really cool things that are broken.  When it comes to the second one, being able to properly diagnose the issue puts you in a much better position to be able to fix it.  When it comes to Service Manager, there is no exception. Service Manager does a pretty good job of logging to the Event Log.  This can be found in the Operations Manager Event Log.  However, there are times when a more detailed analysis of the system is needed in order to properly diagnose what's going on.  This is where tracing come in.  Tracing in SCSM allows you to log in detail information about how it's executing each of its actions.  This information can be vital in helping track down difficult issues, like performance degradation. So how do we enable tracing in Service Manager?  Here are the steps: 1.  In Windows Explorer, browse to the Tools folder in the installation directory of SCSM (e.g. C:\Program Files\Microsoft System Center 2012\Service Manager\Tools). 2.  Open an elevated command prompt and change directories to the folder listed above.  From here, run the script StartSMTracing.cmd to turn tracing on.  Based on the switches you pass, you can turn tracing on for different areas of SCSM and to what level of tracing you desire.  Below are some details of the different switch options StartSMTracing Image Trace Level (-l): Trace Level Image Trace Area (-a): Trace Area Image Tracing Started: Start tracing image 3.  Once you have completed the actions you wished to trace, you can turn tracing off by running the script StopSMTracing.cmd, located in the same folder as the start script.  When you run the stop script, you need to pass the same trace area to the script as the one you used in the start script.  The trace file that is generated, by default, is dumped to the C:\Windows\temp\SMTrace directory. Tracing Stopped: Stop tracing image 4.  If you were to try and open the .etl file that is created, you will quickly discover it is not human readable.  So what we need to do is format the file so we can make sense of what it traced.  In our command prompt, run the TraceFmtSM.exe command, passing the .etl file and the already provided .tmf file (trace message format file). Format trace image 5.  Once the format is complete, it will dump two files to the Tools directory.  One is a summary file (FmtSum.txt) while the other file (FmtFile.txt) provides all of the detail of what was captured. And that's all there is to it.  The last note I will add here is the tracing can bring back TONS of data and can be challenging to interpret exactly what it's doing, but can prove invaluable when it comes to troubleshooting.  So folks, ye be warned! Until the Whole World Hears, Christopher

Christopher Mank

Systems Architect