Configuration of CMA policy
This topic provides best practices for configuring a CMA policy by using macros.
Possible credential use cases
This section provides you the possible credential use cases for the user name fields of Windows user and MS SQL Server login.
To know how to configure CMA policy, click Configuring CMA policy.
This figure shows the Credentials section in the Environments configuration window of the CMA.

The following table lists all possible credential use cases:
Windows user | MS SQL Server login | Result |
|---|---|---|
Entered | Entered | Windows user – the user entered. MS SQL Server login - the user entered. |
Entered | Empty | Windows user – the user entered. MS SQL Server login - the windows user (as integrated user). |
Empty | Entered | Windows user – patrol defaultAccount user. MS SQL Server login - the user entered. |
Empty | Empty | Windows user – patrol defaultAccount user. MS SQL Server login - patrol defaultAccount user (as integrated user). |
CMA fields that supports usage of macros
The following fields in the CMA environment configuration window supports usage of macros:
- Windows user
- MS SQL Server login
- Hostname

When the macro is used, the KM tries to fetch its value by using the following order:
- From the PATROL agent namespace.
- From the machine environment variables.
Configuring single policy to monitor multiple SQL Servers in local monitoring by using macros
- Hostname field:
Set $HOSTNAME (or any other macro which redirect to machine name)The KM uses the macro to fetch the host name as described in the above section. Using local user:
Set ‘$HOSTNAME\<LOCAL_USER>’ OR just ‘\<LOCAL_USER>’ in the windows user field.The value of $HOSTNAME is replaced with the 'hostFQDN' PATROL variable value from the PATROL Agent namespace.Using domain user:
Set ‘$DOMAIN_NAME\<USER_NAME>’You should define the "DOMAIN_NAME" by setting an environment variable as shown below or by adding "DOMAIN_NAME" variable to the PATROL namespace.
For example,
i. In the figure shown below the local windows user named ‘localUser’ is used as the Windows user and the MS SQL Server user ‘sa’ is used as the MS SQL Server login.The value of the macro $HOSTNAME is fetched as described in the above section.

ii. In the figure shown below the local windows user named ‘localUser’ is used as the Windows user and as the MS SQL Server login (as integrated user).