Scripting and programming languages use variables to define important values that allow the NetMRI job engine to respond according to what it sees in the data it's parsing. CCS is no different; in each section of a CCS script (Script, Actions, Issues and Triggers), you use variables to define the values that CCS uses to run CLI commands and to match against output data from network devices.
NetMRI 's job engine recognizes several types of variables:
Well-Known Variables–A set of standard variables universally recognized by the NetMRI job engine in all scripts whereever they are called out. See the section Well-Known Variables for a list and brief descriptions of the well-known variables in the NetMRI system.
Script-Variables–User-defined variables that are used in sections of a script to allow interactive user/admin input during script execution. You define Script-Variables in the Script section of any script. (See the section Script-Variables: for more detail.) When a script runs, a Script-Variable prompts the user running the script to enter the value (IP address, user name, device name, etc...).
A Script-Variable can refer to lists in the NetMRI system (Configuration Management –> Job Management tab –> Lists) as an input type. (See and The getListValue( ) Function for more detail.)
Trigger-Variables–A special variable type, limited to Trigger sections, that is used to extract pieces of information from the command-line output resulting from an Action-Command attribute. Consult the topic Trigger-Variables: for more information.
SET variables–Custom, user-defined variables that can be declared only in specific Command scripting attributes. SET variables can also reference lists, which are two-dimensional tables of data that are installed into the Lists page in NetMRI. See Setting Variables in Command Attributes for more.)
Note: A longer list of NetMRI-standard scripting variables can be found in the section "Scripting Well-Known Variables (Perl and CCS)" in the Infoblox NetMRI Administrator Guide or in online Help.
In CCS scripts, you always declare a variable by using a dollar sign, which is also the sign of a Perl scalar variable:
$vendor
CCS scripts also reference declared variables with the dollar sign. Setting a value for a variable requires standard arguments:
- eq (Equal to)
- like (Similar to, used with wildcards)
- in (variable value is contained in the following)
- ne (not equal to)
Declaring a variable, even if you do not assign it a value, also requires declaring its type, including the possibility of using a list:
- regular expression (example in section Setting Variables in Command Attributes)
- word (string)
- boolean
- string
- list