FAQ: Perl Based USER Monitor Script Restrictions in NetScaler

FAQ: Perl Based USER Monitor Script Restrictions in NetScaler

book

Article ID: CTX209096

calendar_today

Updated On:

Description

In cases where the NetScaler does not include specific monitors, a Citrix-supplied or customer-written Perl script can be used to make a query against a network resource. These scripts are very flexible, but there are some restrictions on the passed parameters that must be understood to configure them. They are configured with the USER monitor type.

Script Restrictions

When defining a USER-type monitor, which uses a Perl-based script to make a query, the parameters are passed to the NetScaler using a TCP POST transaction. This transaction must have a maximum length of 160 bytes, including the IP address and port, which must also be passed. That leaves a maximum length of around 100 bytes (depending on the length of the IP address and port) for the parameters defined in the Script Arguments field of the USER monitor. The limit on the characters is 124 bytes minus the length of the IP address and the length of the port number.

Additionally, any necessary characters that are not compatible with a URL must be URL encoded to allow the POST to send them properly. For example, a space character must be encoded as %20.

For example, with an IP address of 10.1.2.3 and port 3306, the maximum length of the parameter would be 112 (124 minus the 12 characters in the IP address and port). URL-encoded characters take up to 3 bytes each (percent sign plus the hex equivalent of the character). The query shown below would have a character count of 100, keeping it inside of the limits described in this article.

Sample script argument - database=testdb;user=testuser;password=testpw;query=select%20%2a%20from%20table%20where%20name=Smith

The parameter above has a total length of 100 characters. Because the maximum amount of characters needed for an IP address and port number is 20, the total length is acceptable.

Issue/Introduction

This article describes the restrictions that are necessary to understand for Perl-based monitor script parameters.