ADC

Configure a user monitor

User monitors track the health of custom applications and protocols that a Citrix ADC appliance does not support. This is an extended scope of custom monitors. To configure a user monitor, you must perform the following steps:

  • Write a script that can monitor the services bound to it.
  • Upload the script to the /nsconfig/monitors directory on the Citrix ADC appliance.
  • Provide executable permission to the script.

If the monitor type is a protocol that the appliance does not support, only then you must use a monitor of type USER. User monitors support only Perl and Bash type scripts. They do not support Python scripts.

Note

Monitor probes originate from the NSIP address. The scriptargs configured for the monitor type USER is displayed in the running configuration and ns.conf files.

For more information about monitors, see Configure monitors.

To configure a user monitor by using the CLI

At the command prompt, type:

add lb monitor <monitorName> USER -scriptname <NameOfScript> -scriptargs <Arguments> -secureargs <Arguments>
<!--NeedCopy-->

Example1:

add monitor Monitor-User-1 USER -scriptname nsftp.pl -scriptargs "file=/home/user/
sample.txt;user=root;password=passwd"
<!--NeedCopy-->

Example2:

add monitor Monitor-User-1 USER -scriptname nsftp.pl -scriptargs "file=/home/user/
sample.txt -secureargs "user=root;password=passwd"
<!--NeedCopy-->

Note

The secureargs parameter stores the script arguments in an encrypted format instead of the plain text format. Citrix recommends you use the secureargs parameter instead of the scriptargs parameter for any sensitive data that is related to the scripts, for example, user name and password. If you choose to use both the parameters together, the script specified in -scriptname must accept the arguments in the order: <scriptargs> <secureargs>. Specify the first few arguments in the <scriptargs> parameter; and the rest of the arguments in the <secureargs> parameter. That is, maintain the order defined for the arguments. Secure arguments are applicable only for the internal dispatcher. If you want to use an external dispatcher, Citrix recommends securing the vulnerable data in your scripts.

Example 3:

Let’s say you have already configured the scriptargs parameter with the arguments: “a=b;c=d;e=f”.

add monitor mon1 USER -scriptargs "a=b;c=d;e=f"
<!--NeedCopy-->

If you want to use the secureargs parameter instead of scriptargs parameter, do the following:

  • Nullify the scriptargs parameter.
  • Provide all the arguments under secureargs parameter.
set monitor mon1 USER -scriptargs "" -secureargs "a=b;c=d;e=f"
<!--NeedCopy-->

To configure a user monitor by using the GUI

  1. Navigate to Traffic Management> Load Balancing> Monitors, click Add.
  2. In the Create monitor page, do the following:
    • Select the monitor type as USER.
    • Choose the script from the drop-down menu or upload your own script.
    • Enter appropriate values for the Script Arguments and Secure Arguments fields.
    • Click Create.

    A user monitor is created.

Configure a user monitor