Using the HTML Injection feature to insert data that can be used to measure application performance using an analysis tool like the Citrix Edgesight for NetScaler.
Summary
The HTML Injection feature measures application performance in combination with applications such as the Citrix EdgeSight for NetScaler server or the Symphoniq TrueView server.
This section describes the steps to configure HTML Injection for performance measurement using the Citrix EdgeSight for NetScaler server.
Measuring Application Performance Using a Citrix EdgeSight for NetScaler Server
You can use the HTML Injection feature to measure performance in combination with the Citrix EdgeSight for NetScaler server. You will need to inject appropriate Javascript to send the required data to the EdgeSight server.
The injected JavaScript will record various values such as system ID, HTTP transaction ID and other transaction performance measurement timestamps. The JavaScript then executes on the client browser and sends performance data to the EdgeSight for NetScaler database and report generation server.
You can then use the EdgeSight for NetScaler server console to view performance results based on the data collected. You can also use the EdgeSight for NetScaler console to set a number of other operational parameters and user preferences.
-
Citrix EdgeSight for NetScaler Installation Guide
In order to configure the system for performance mgeasurement using the Citrix EdgeSight server, you must create specific prebody and postbody scripts, then bind them on the system. Once the policies are bound, data is sent to the Citrix EdgeSight for NetScaler server to enable performance analysis and measurement.
In the following example, the client connects to a Citrix NetScaler system that hosts the site _http://www.a.com_. A Citrix Edgesight for NetScaler server, _http://ens.citrix.com_, is used to measure application performance for all traffic flowing through the Citrix NetScaler system. The following table lists the names and values of the entities that must be configured on the system before you can set up performance monitoring as described in the example..
.
Application Performance Measurement with Citrix EdgeSight for NetScaler
Enabling the HTML Injection Feature
To enable the HTML Injection feature
- In the left pane, expand System, then click Settings. The Settings page appears in the right pane.
- In the Modes & Features group, click Advanced Features. The Configure Advanced Features dialog box appears.
- Choose HTML Injection and click OK. Click Yes on the Enable/Disable Feature(s)? confirmation message that appears.
The HTML Injection feature is enabled on the system.
Configuring Prebody and Postbody files for the Citrix EdgeSight for NetScaler Server
The system provides Citrix EdgeSight-specific prebody and postbody Javascript files that you can modify and use for performance measurement. These files are available in the /nsconfig/htmlinjection/ens folder.
Open the prebody.js file in any editor of your choice and modify the EdgeSight server variable to reflect the location of the Citrix EdgeSight server in your network.
For example, if the Citrix EdgeSight server is located at http://ens.citrix.com, you should change the EdgeSight server variable to http://ens.citrix.com.
You can also customize the Citrix EdgeSight-specific prebody and postbody Javascript files by including other system internal variables as required.
Once the prebody and postbody files are configured, you can create HTML Injection policies, as described earlier, and use them to measure performance in conjunction with the Citrix EdgeSight server.
Specifying Files to be used for Injection
This section describes how to specify that the system should use the Citrix EdgeSight for NetScaler files provided on the NetScaler system for prebody and postbody insertion.
To specify files to be used for prebody injection,
- In the left pane, click Protection Features. The Protection Features page appears in the right pane.
- Under Protection Features Overview click HTML Injection. The Configure HTML Injection dialog box appears.
- Click the Browse button next to the Prebody text box. The contents of the /nsconfig/htmlinjection folder appear by default.
- Double-click the ens folder. The contents of the ens folder appear.
- Select prebody.js and click OK.
To specify files to be used for postbody injection,
- In the left pane, click Protection Features. The Protection Features page appears in the right pane.
- Under Protection Features Overview click HTML Injection. The Configure HTML Injection dialog box appears.
- Click the Browse button next to the Postbody text box. The contents of the /nsconfig/htmlinjection folder appear by default.
- Double-click the ens folder. The contents of the ens folder appear.
- Select postbody.js and click OK.
Injecting Data into the HTTP Body
Creating Filter Actions
This section describes how to create two filter actions, Action-Filter-Prebody and Action-Filter-Postbody, that insert the contents of the prebody and postbody files into the HTTP body.
To add a prebody filter action
- In the left pane, expand Protection Features, then click Filter. The Filter page appears on the right pane.
- Click the Actions tab.
- Click Add. The Create Filter Action dialog box appears.
- In the Action Name text box, type the name of the filter action, for example, Action-Filter-Prebody.
- Under Qualifier, choose Add.
- In the Value list, select Prebody.
- Click Create. The filter action Action-Filter-Prebody is created.
To add a Postbody Filter Action,
- In the left pane, expand Protection Features, then click Filter. The Filter page appears on the right pane.
- Click the Actions tab.
- Click Add. The Create Filter Action dialog box appears. See figure above.
- In the Action Name text box, type Action-Filter-Postbody.
- Under Qualifier, choose Add.
- In the Value list, select Postbody.
- Click Create. The filter action Action-Filter-Postbody is created.
Creating Filter Policies
In this section, you will create two filter policies, Policy-Filter-Prebody and Policy-Filter-Postbody, and bind them to a virtual server for use in prebody and postbody injection.
To add a prebody filter policy
- In the left pane, expand Protection Features, then click Filter. The Filter page appears in the right pane.
- Click Add. The Create Filter Policy dialog box appears as shown in the figure.
- In the Filter Name text box, type Policy-Filter-Prebody.
- Under Response Action, choose the filter action, Action-Filter-Prebody, to be associated with this policy.
- Under General Named Expressions, select the built-in general expression ns_true, then click Add Expression. The expression ns_true now appears in the Expression text box
- Click OK, then click Close. The new filter policy Policy-Filter-Prebody, appears in the Filter Policies page.
To add a postbody filter policy,
- In the left pane, expand Protection Features, then click Filter. The Filter page appears in the right pane.
- Click Add. The Create Filter Policy dialog box appears as shown in the figure.
- In the Filter Name text box, type Policy-Filter-Postbody.
- Under Response Action, choose the filter action, Action-Filter-Postbody, to be associated with this policy.
- Under General Named Expressions, select the built-in general expression ns_true, then click Add Expression. The expression ns_true now appears in the Expression text box
- Click OK, then click Close. The new filter policy Policy-Filter-Postbody, appears in the Filter Policies page.
Binding Filter Policies
This section describes the steps to bind the filter policies you created in the previous section, Policy-Filter-Prebody and Policy-Filter-Postbody, to the load balancing virtual server Vserver-LB-ENS.
To bind the prebody filter policy to the load balancing vserver,
- In the left pane, expand Load Balancing and click Virtual Servers. The Load Balancing Virtual Servers page appears in the right pane.
- Select Vserver-LB-ENS and click Open. The Configure Virtual Server (Load Balancing) dialog box appears.
- Select the Policies tab to view the policies configured on the system.
- Select the check box next to Policy-Filter-Prebody
- Click OK. The filter policy Filter-Policy-Prebody is bound to the virtual server Vserver-LB-ENS.
To bind the postbody filter policy to the load balancing vserver,
- In the left pane, expand Load Balancing and click Virtual Servers. The Load Balancing Virtual Servers page appears in the right pane.
- Select Vserver-LB-ENS and click Open. The Configure Virtual Server (Load Balancing) dialog box appears.
- Select the Policies tab to view the policies configured on the system.
- Select the check box next to Policy-Filter-Postbody
- Click OK. The filter policy Filter-Policy-Postbody is bound to the virtual server Vserver-LB-ENS.
More Information