Script-Filter
Used In: Script sections
Status: Mandatory
A script attribute that defines the devices that will be acted upon by the CCS script. When a script runs, the Script-Filter
ensures that no matter what device group is chosen, the script will run only on the devices that the user wants.
Use the Script-Filter
attribute to specify the set of network devices (by IP address range, model type, NetMRI Device Group, etc...) to be acted upon by the CCS script during execution. Filtering uses the same syntax used for defining device groups (see the Understanding Group Membership Criteria topic in online Help for details). Filtering uses variables to specify the data types and value ranges required by the script. To tie more than one variable into a Script-Filter
attribute, use Boolean operators such as “&&” (“and”), and the “|” character (“or”).
You can also nest logical operators using parentheses ( ). For some variables, you can use multiple matches enclosed by square brackets “[ ]”.
Example
A single AND operator is used.
Script-Filter:
$Vendor eq "Cisco" and $Model in ["2811", "2821", "871", "2621XM"]
A filter can use multiple AND operators, or whatever logic is necessary for filtering.
Script-Filter:
$Vendor eq "Cisco" and
$sysDescr like /IOS/ and
$Version like /^1[2-9]/ and
$Type in ['Router', 'Switch-Router']]
A more complex Boolean operation is used, with parentheses encapsulating arguments.
Script-Filter:
($Vendor eq "Cisco" && $Model in ["2811", "2821", "871", "2621XM"]) or
($Vendor eq "Extreme" and $sysDescr like /XOS/)