Previous Topic: Configure Subnet Scan for Locations RuleNext Topic: (Optional) Configure Scan Timeout


Configure Script for Locations Rule

You can add a script to run on the agent and determine which scalability server to use. Your responsibility includes delivering the script to the agent computer.

Follow these steps:

  1. Double-click the new value in the Script column.

    The Setting Properties dialog opens.

  2. In the Value field, specify the name of the DM script, then click OK.

    Note: You can specify the script location as an absolute or relative path. A relative path is relative to the ITCM installation directory, which is typically at one of the following locations:

    Windows:

    C:\Program Files(x86)\CA\DSM

    Unix, Linux:

    /opt/CA/DSM

    The feature passes the following parameters to the server selection script:

    -o <output file name>

    Names the file where the script writes the name of the scalability server that it identifies.

    -x <error file name>

    Names the file where the script writes any error information it generates.

    -a <matching address>

    Identifies the address that matched, resulting in running this script.

    The DM script is configured for the location rule.

    Note: If you specify the script, leave the Scalability Server and Subnet Scan columns empty. If you are not using Subnet Scan, leave the Subnet Scan column empty.

Example:

rem ---------------------------------------------------------------------
rem Simple location aware server identification script
rem This script writes a hard coded server name to the output file
rem ---------------------------------------------------------------------

dim sMatchingAddress as string
dim sOutputFileName as string
dim sErrorFileName as string

dim X as Integer 
FOR X=0 to argc()
	
	rem Read the output file from the provided parameters
    
	if ( argv(X)="-o") THEN
        sOutputFileName = argv(X+1)
        ENDIF
	
	rem read the matching address from the provided parameters

    if ( argv(X)="-a") THEN
        sMatchingAddress = argv(X+1)
        ENDIF

	rem read the matching address from the provided parameters

	if ( argv(X)="-x") THEN
        sErrorFileName = argv(X+1)
        ENDIF

NEXT X

dim fHandle as integer

fHandle = OpenFile(sOutputFileName,O_WRITE) 
IF NOT(EOF(fHandle)) Then 
	WriteFile(fHandle,"sampleserver.ca.com")
	CloseFile(fHandle)
	exit
ENDIF
exit