Create a custom script for a legacy Software Asset Management plugin license type

By default, the Script field in the legacy Software Asset Management (com.snc.software_asset_management) plugin Software License Calculation form contains information about available variables and an example script.

You can use the example as the basis of the custom script or replace the example entirely.

You can use the following variables in the custom script.

The following functions are available as part of the SAMUtil script include and can be used in custom scripts.

Note: All of these functions utilize and depend on the variables mentioned above.
Table 2. Custom script functions
Functions Description
getWorkstationInstallsOrUsages Returns a list of other installs on the given workstation.
getUserInstallsOrUsages Returns a list of all other installs belonging to the user.
createCounterViolation Returns insert a counter violation for the current counter with the given cause.

Example:

The following script uses the number of rights equal to the number of CPU sockets on the machine the script is installed on. The workstation variable is used to identify any workstation that is in the development environment. If such a workstation is found, the script then assigns a valuation equal to the number of CPU sockets on the machine. Otherwise, if the workstation is not in the development environment, then no rights are assigned.

Figure 1. SAM custom calculation type
SAM custom calculation type