LogicModule AppliesTo Functions
The Applies To field in a LogicModules indicates the types of devices from which this module should attempt to gather instrumentation. AppliesTo logic is fundamental to how a LogicModule discovers resources to which it should be assigned, as discussed in What Is AppliesTo Scripting?.
AppliesTo Best Practices
AppliesTo uses what we lovingly refer to as AppliesTo Scripting to determine which types of devices a LogicModule should apply.
AppliesTo setting is designed to be neither overly broad (e.g. using the isLinux() method) nor overly narrow (e.g. to a single host). For instance, typically it's best that -- where possible -- a DataSource is applied to a system.category via the hasCategory() method, and that a corresponding PropertySource or SNMP SysOID Map build to automatically set the system.category.
Changing the AppliesTo Field
Changing the AppliesTo field may change which devices have instances discovered, and may result in the removal of instances and data associated with the LogicModule on an affected devices. As a best practice, we recommend 'testing' all Applies To changes before saving them.
You can test Applies To changes via the Applies To wizard:
Selecting the test button will display the number of devices affected by the change. You can then select 'show me' to view a list of devices that will be applied or un-applied as a result of the change. This list can be exported to csv.
You can centralize your LogicModule configuration by creating standardized AppliesTo Function. For example, if you had 3 separate modules that you wished to apply to all devices that are in two specific groups, you could define an AppliesTo function FrontEnds to express that:
contains(system.groups, "Front End Tier1") || contains(system.groups, "Front End Tier2")
Then have the modules call the function in their AppliesTo field like this: FrontEnds() . Later, if you wished to apply the module to a third group, you could simply edit the function, rather than editing the 3 separate modules.
AppliesTo Functions are managed from Settings | LogicModules | AppliesTo Functions.
They require the following configuration:
Add a descriptive name for your new AppliesTo Function
Identify the purpose and scope of this particular AppliesTo Function
An AppliesTo Scripting string that defines the function's query.
EX. isLinux() && system.sysinfo !~ "Remote Access Controller" && (system.sysinfo !~ "Powerfile Active Archive Appliance") | | hasCategory("AIX") | | sysinfo =~ "SunOS" | | system.sysinfo =~ "FreeBSD" | | isWindows() | | system.sysinfo =~ "Darwin Kernel"