Symantec Indepth for Microsoft.NET postinstallation and configuration Technical Note
Symantec Indepth for Microsoft.NET postinstallation and configuration Copyright 2006 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo, Symantec i 3, Symantec Indepth, Symantec Inform, and Symantec Insight are trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Microsoft, Microsoft Windows, and Microsoft Excel are registered trademarks of Microsoft Corporation. Other names may be trademarks of their respective owners. The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Symantec Corporation and its licensors, if any. THIS DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID, SYMANTEC CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Software and Documentation are deemed to be commercial computer software and commercial computer software documentation as defined in FAR Sections 12.212 and DFARS Section 227.7202. Symantec Corporation 20330 Stevens Creek Blvd. Cupertino, CA 95014 www.symantec.com Technical support For technical assistance, http://www.symantec.com/enterprise/support/ index.jsp and select phone or email support. Use the Knowledge Base search feature to access resources such as TechNotes, product alerts, software downloads, hardware compatibility lists, and our customer email notification service.
Contents Chapter 1 Symantec Indepth for Microsoft.NET post-installation and configuration Scope... 3 Configuring DLLs, classes, and methods to instrument... 4 Permission settings for a Symantec i 3 installation folder... 5 Changing the activity tracking threshold... 5 Configuring Indepth for Microsoft.NET to monitor SQL Server 2005.NET instances... 7 About Indepth for Microsoft.NET agent ports... 9
2 Contents
Chapter 1 Symantec Indepth for Microsoft.NET postinstallation and configuration This chapter includes the following topics: Scope Configuring DLLs, classes, and methods to instrument Permission settings for a Symantec i 3 installation folder Changing the activity tracking threshold Configuring Indepth for Microsoft.NET to monitor SQL Server 2005.NET instances About Indepth for Microsoft.NET agent ports Scope The scope of this technical note is to elaborate on and to give examples of the manual action items that need to be performed after adding a new.net instance. The actions are needed to configure the product correctly and to be able see data in the product's user interface.
4 Symantec Indepth for Microsoft.NET post-installation and configuration Configuring DLLs, classes, and methods to instrument Configuring DLLs, classes, and methods to instrument You can add the DLLs you wish to monitor using the DLLs dialog box in the Instrumentation Settings menu, as explained in the Indepth for Microsoft.NET Users Guide. But afterwards you must edit the file instrumentation.xml manually to define which classes and methods to instrument. The Indepth for Microsoft.NET activity tracking is based on instrumentation of your application DLLs. This information is configured in the instrumentation.xml file. The way you configure this file (this means which DLLs to instrument and which classes or methods) affect how much information will be tracked and also the overhead of the Indepth for Microsoft.NET activity tracking on your application. The instrumentation.xml file contains many configurable settings, which are explained in the Administration Guide in detail. The following file is an example section of the instrumentation.xml file which configures the instrumentation of the Microsoft Petshop sample Web application: <instance name="aspnetiis5"> <dlls> <dll name="pet*.dll" /><!- instrument all DLLs that start with pet* -!> </dlls> <instrument> <classes> <class> <name>petshop.*</name><!- instrument all classes of which the namespace begins with Petshop -!> <called-method> <methods> <method> <name>*</name><!- instrument all methods in each class -!> </method> </methods> </called-method> </class> </classes> </instrument>.
Symantec Indepth for Microsoft.NET post-installation and configuration Permission settings for a Symantec i 3 installation folder 5 Permission settings for a Symantec i 3 installation folder The Indepth for Microsoft.NET hooks that are injected into the monitored.net process, are run under the same user account on which your.net application is running. This user must have full access rights the <i3_root> folder and all its sub-folders. You can change the security settings of the <i3_root> folder with the Windows File Explorer Security tab. Use the following guidelines to find out to which user you need to add permissions: For an ASP.NET instance, the working process user account depends on the IIS configuration:. IIS5 IIS6 The default account is usually ASPNET. Use... to verify under which account the working process aspnet_wp.exe executes. The default account is usually NETWORK SERVICE, but it depends on your application pool settings. Use... to verify under which account(s) the working process w3wp.exe executes, or check the different application pools in the IIS Management Console. If you have several application pools which translate into different Windows users, all these users must be granted full permission to the <i3_root> folder. Changing the activity tracking threshold The Indepth for Microsoft.NET installation pre-configures the activity data tracking threshold and sets it to 50 milliseconds. This means that only methods, service requests, SQL statements, and Web services that have a service time that is equal or greater than 50 milliseconds will be collected. You can change this default value in the ActivityCollector.xml file, located in the <i3_root>/products/dotnet/config folder any time after the installation:
6 Symantec Indepth for Microsoft.NET post-installation and configuration Changing the activity tracking threshold <activity-collector-config> <!-- psdn_act_col.exe configuration, configurable per server (default) & per instance --> <aggregator> <topnsql>5</topnsql><!-- Top n SQL statement to monitor --> <sla>5000</sla><!-- Red SLA breach value for top HTTP invocations in msec. --> <nearsla>1000</nearsla><!-- Yellow SLA breach value for top http invocations in msec. --> <insane-rt>300</insane-rt><!-- Long running thread timeout in seconds --> <bit-vector>false</bit-vector> <last-level-bit-vector>false</last-level-bit-vector> </aggregator> <!-- Tracker.dll settings, configurable per server (default) & per instance --> <tracker> <threshold>50</threshold><!-- Threshold in msec for filtering out events before forwarding it to the Collector agent. --> </tracker> </activity-collector-config> Note: The new setting will only take affect after your.net application is restarted. For ASP.NET that means an IIS reset or recycling the application pool. Note: This setting has a significant affect on the overall overhead of Indepth for Microsoft.NET agent on your system. Lowering this value too much can cause your Web application and server to slow down considerably. If Indepth for Microsoft.NET is installed on a development server, you can set this value to 0 to collect all data. On heavy loaded production systems, it is advisable not to change the default. More information about controlling the Indepth for Microsoft.NET overhead on your.net application in the Symantec i 3 Administration guide.
Symantec Indepth for Microsoft.NET post-installation and configuration Configuring Indepth for Microsoft.NET to monitor SQL Server 2005.NET instances 7 Configuring Indepth for Microsoft.NET to monitor SQL Server 2005.NET instances SQL Server 2005 has built-in capabilities that allows you to run stored procedures or functions written in.net. The SQL Server 2005 executable contains a.net Framework 2.0 CLR that is in charge of this task. The.NET stored procedures or functions are compiled with Visual Studio 2005 into assemblies (DLLs) and deployed in one or more databases of the SQL Server 2005 instance. When deploying an assembly in the database, either using the SQL Server 2005 Management Studio or using the SQL command CREATE ASSEMBLY, you must specify the security permissions of the DLL. This can be one of the following: SAFE, EXTERNAL, or UNSAFE. Figure 1-1 shows an example of an assembly named mysqlcode.dll that is deployed in the SQL Server 2005 database, using Management Studio: Figure 1-1 New Assembly
8 Symantec Indepth for Microsoft.NET post-installation and configuration Configuring Indepth for Microsoft.NET to monitor SQL Server 2005.NET instances After adding a SQL Server 2005 instance to Indepth for Microsoft.NET, you can add the DLL names (hosted in SQL Server 2005) you wish to monitor with Indepth for Microsoft.NET in the instrumentation.xml file using the DLL Instrumentation Settings dialog box in the Indepth for Microsoft.NET user interface (as you would for any other DLL). Indepth for Microsoft.NET is only capable of monitoring.net activity in SQL Server 2005 if its permission is set to UNSAFE. Trying to monitor a DLL that was deployed with type SAFE or EXTERNAL may result in a security exception that your.net code raises when invoked inside SQL Server 2005. To minimize the risk of adding a DLL for instrumentation that is not of type UNSAFE, you must specify the permission type of the DLL you wish to instrument. This must be done manually in the instrumentation.xml file. For example, adding mysqlcode.dll to the instrumentation.xml file requires the following line to be present: <instance name="sqlserver2005" tracker="trackersql"> <dlls> <dll name="mysqlcode.dll" permission="unsafe"/> </dlls> The permission="unsafe" should be added manually to the instrumentation.xml file using a text editor. Without adding this, the Indepth for Microsoft.NET will not be able to monitor your stored procedure.net assembly. Note that the Indepth for Microsoft.NET Collector tracking agent must be installed on each database where an instrumented DLL exist. For example, the mysqlcode.dll is deployed in master and tempdb databases. When installing the Indepth for Microsoft.NET SQL Server 2005.NET instance, you must specify both databases in the databases selection screen. If you are unsure where mysqlcode.dll is deployed, you can specify all databases of the SQL Server 2005 instance that need to be monitored and installed with the Indepth for Microsoft.NET tracking agent.
Symantec Indepth for Microsoft.NET post-installation and configuration About Indepth for Microsoft.NET agent ports 9 About Indepth for Microsoft.NET agent ports The Indepth for Microsoft.NET data collection is based on establishing a TCP connection between a tracking module (tracker.dll), the activity collector agent and instrumentation agent. The default port numbers for the installation are respectively 20755 and 20756. If any of these port numbers are in use by another application on the server, you can change its value respectively in the collector.xml and instrumenter.xml files. Port conflicts can cause the Indepth for Microsoft.NET Collector agent not to work and to submit errors. The following is an error example that can appear in the dotnet.collector.activity.trc file: ======================================== ID : CONFIG-0000000 Time : 2006-11-23 10:03:54.750 GMT+02 i3 Time : 2006-11-23 08:03:54.750 GMT Process : psdn_dncol_act.exe -l (ID:2704) Logger : com.symantec.apm.i4dotnet.collector.activity Msg : Exception in remoting : System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted ======================================== The following is an error example that can appear in the dotnet.collector.dncol_isntr.trc file: ======================================== ID : CONFIG-0000000 Time : 2006-11-23 10:09:05.842 GMT+02 i3 Time : 2006-11-23 08:09:05.842 GMT Process : psdn_dncol_instr.exe (ID:4972) Logger : com.symantec.apm.i4dotnet.collector.dncol_instr Msg : Unable to setup TCP server on port 20756, check that it is not used by another process, ex=only one usage of each socket address (protocol/network address/port) is normally permitted ========================================
10 Symantec Indepth for Microsoft.NET post-installation and configuration About Indepth for Microsoft.NET agent ports