Terminology & Syntax

AppliesTo Scripting Examples

All devices with "snmp" in the system.categories property, excluding Windows devices, will have this datasource applied:

Applies To Examples

Whereas only those devices with the CiscoASA value in the system.categories property (which, as we saw in the OID to Category mapping page, will be those whose sysoid best matches a regular expression in that table with that tag) will have this datasource applied:

Users can add their own values to the system.categories property of devices or groups. If added to groups, all devices in those groups will inherit the property. If system.categories property already exists, you can append values to it as a comma separated list.  

Applies To Examples

true() Applies to all devices.  Note that simply because a datasource applies to the device, this does not ensure that the datasource will collect data. If the datasource is a multi-instance datasource, no data will be collected unless one or more instances exist. They may be discovered by ActiveDiscovery, or manually added.
false() Applies to no devices. Will not discover instances or collect data.
hasCategory("Netscreen") Applies to devices whose system.categories property contains the value "Netscreen".  This property is most likely set by the OID to category mapping table, but may also be extended manually.
contains(system.groups, "network gear") Applies the datasource to all devices in the “network gear” group.
NetSNMPComputers() Calls the User Defined Function NetSNMPComputers()
isWindows() && (system.sysinfo =~ "x64" || system.sysinfo =~ "Vista") Applies to Windows devices running a 64 bit operating system, or Vista.
getPropValue("system.aws.tag.aws:cloudformation:stack-name") == "lab-testbed" References AWS instance tags. Necessary due to the colon in the property name.
isCisco() && system.displayname !~ "mfw*" Apples to all Cisco Devices except those that start with the letters 'mfw' in their display name.

More functions and operators can be found on the AppliesTo Scripting page.

User Defined Function Example

NetSNMPComputers() hasCategory("Netsnmp") && system.sysinfo !~ "Remote Access Controller"

This function would match all systems with the value "Netsnmp" within their system.categories property, but exclude those whose system.sysinfo property contained the string "Remote Access Controller". This allows you to add other exclusions to this function, and it will be applied to all the datasources that use it. (In this case, this is used to prevent attempting to collect data such as CPU counters that most Netsnmp systems support, but Remote Access Controllers do not.)