The following is a list of common debugging techniques that I use to develop on the Symantec Management Platform (SMP). Tip #1 - Check your Server logs Whenever you encounter an error, check the Altiris Log Viewer for errors. The Altiris Log Viewer can be accessed from start > All Programs > Symantec > Diagnostics > Altiris Log Viewer. If you have Visual Studio Integration installed, the log viewer can be accessed from within Visual Studio using the Tools menu at tools > Altiris > Open Log Viewer. The Altiris Log Viewer will record activity occurring on the SMP server. Server logging information is stored on disk at %programfiles%\Altiris\Notification Server\Logs by default. Verbose logging is disabled by default. If you have a problem that you are unable to solve, you can enable trace logging to see if there is more information available. To enable trace logging, open the Altiris Console (http://localhost/altiris/console) and navigate to Settings > All Settings, Settings > Notification Server > Notification Server Settings, then click the "Logging" tab and check the "Trace" check box and click the OK button in the lower right. Tip #2 - Check your Agent logs You can also view the local Client Agent logging information with the Altiris Log Viewer. Remote Client Agent logs are not sent from managed machines to the SMP server. For remote agents, you can copy the agent log information stored at %public%\Documents\Altiris\Altiris Agent\Logs (Vista operating systems) to the server and load the log files using the Altiris Log Viewer.
The Agent Logs can also be viewed locally on the remote client machine using the Agent Log Viewer. The Agent Log Viewer is packaged with Agent Diagnostics tool which is unregistered by default. To register Agent Diagnostics, set %programfiles%\Altiris\Altiris Agent as the working directory and run this from the command line : regsvr32 AeXAgentDiagnostics.dll With Agent Diagnostics registered, you can access the Agent Log Viewer by right clicking the Altiris Agent icon in the notification area of the task bar. In the context menu, select Diagnostics > Log Viewer. To remove Agent Diagnostics run : regsvr32 /u AeXAgentDiagnostics.dll Tip #3 - Write to the logs In server code, you can write to the Altiris Log Viewer using the class Altiris.NS.Logging.EventLog. In client agent code, you can write to Agent Log files using CEReportEvent(UINT, LPCWSTR, LPCWSTR) defined in cereportevent.h. This is imported in stdafx.h file created by the SDK. Tip #4 - Attaching to Processes
Note: Whenever you recompile code and wish to debug, you will often need to restart one or more services listed above. Tip #5 - How to debug code that is difficult to attach and reach There are cases in which you have code that runs before you can attach to it. For server code, you can use the .NET API System.Diagnostics.Debugger.Break( ). This API will cause a debugger dialog to display asking you if you would like to attach to the process after which you can begin debugging. For client code, it is easiest to simply throw an assert or message box at the point in which you would like to begin debugging. When that point is reached, attach to the AeXNSClient.exe process. Tip #6 - Debugging Javascript Though the console does not support Firefox. I find that Firefox has the best debugging tools. Firefox has great add-ons. For debugging JavaScript, I like using the Firebug add-on. Firebug includes a lot of debugging tools that really helps develop and debug JavaScript. For more information see these links : https://addons.mozilla.org/en-US/firefox/addon/1843/ http://getfirebug.com/wiki/index.php/Main_Page You can also use Visual Studio to debug javascript. To use Visual Studio, you will need to ensure that "Disable script debugging" options are unchecked in Advanced Internet Option settings. Microsoft has also provided a tool similar to Firebug called IE Developer toolbar which is available here - http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038 Tip #7 - Debugging Installs I have written another article on this topic. Read about it here - https://www-secure.symantec.com/connect/articles/testing-solution-msis