Each datasource has an AppliesTo field, which controls which hosts the datasource is applied to. LMS is the language used to express whether a datasource applies to a host, given a host's properties as input. If, given the set of properties of the host as input, the LMS expression evaluates to True, then the datasource applies to the host. If not, the datasource does not apply to the host. For an overview, see Determining Whether a Datasource Applies to a Host in the Architecture section. For some quick examples, see the LMS Examples.
Passing Properties in to the LMS script
Properties are referred to in LMS scripts in the same way they are displayed. To display the properties for a host, click the "Properties" tab at the top of the Hosts screen. Properties will then be shown in place of the Alerts for the host:

All properties can then be referred to in LMS by using the property name as an unquoted string. e.g. system.ips
Tests Available in LMS
The following tests are available in LMS expressions:
| "==" | Equals |
| "!=" | Not Equals |
| ">" | Greater Than |
| ">=" | Greater Than or Equal to |
| "<" | Less Than |
| "<=" | Less Than or Equal to |
| "and" | "&&" | logical AND - either expression may be used |
| "or" | "||" | logical OR - either expression may be used |
| "(" ")" | grouping operator |
| "=~" | regular expression equality. e.g. system.sysinfo =~ "Vista" |
| "!~" | regular expression inequality e.g. system.sysinfo !~ "x64" |
| "!" | logical NOT |
Functions Available in LMS
| true() | Always returns True. |
| false() | Always returns False. |
| contains (array, "value") | Returns True if the specified array of the host contains the specified value. e.g. contains(system.groups, "network gear") would apply the datasource to all hosts in the "network gear" group. The string comparison is not case sensitive. The string being matched does not support regular expressions or globs - it is only a match comparison. |
| hasCategory("category") | Returns True if the system.categories of the host contains the string "category". The string comparison is not case sensitive. |
| startsWith(property,"value") | Returns True if the property "property" starts with "value". e.g. startswith(system.sysinfo,"Cisco") will return True for those hosts that have a system.sysinfo property that starts with the string "Cisco". The string comparison is not case sensitive. |
| join(array,string) | Flattens the array into a single string, separated by the string separator. e.g. join(system.ips,",") =~ "1.1.1.*" will allow you to test for regex equivalence against the array of IP addresses for a host.e.g. to return True for all hosts that are members of a group Foo or its sub-groups - use join(system.groups,",") =~ "Foo" |
| exists(property) | returns true if the property is defined for the host. |
Convenience Functions
There are a few convenience functions defined in LMS.
| isWindows() | Returns True() if the system is a Microsoft Windows system |
| isNetApp() | Returns True() if the system is a NetApp system |
| isNetscaler() | Returns True() if the system is a Citrix Netscaler system |
| isCisco() | Returns True() if the system is a Cisco Systems system |
User Defined Functions
User Defined Functions are defined globally, and can then be called by any datasource.
User Defined Functions are shown in the Datasource tab, at the bottom of the left hand tree panel, in the node Functions:
Clicking on a function will display it in the right hand pane, for editing or review. To add a new function, select the New button, and select Function.
User defined functions are used to centralize the configuration changes of several datasources. For example, if you had 3 separate datasources that you wished to apply to all hosts that are in two specific groups, you could define a function FrontEnds to express that:
contains(system.groups, "Front End Tier1") || contains(system.groups, "Front End Tier2")
Then have the 2 datasources call the function in their AppliesTo field: FrontEnds() . Later, if you wished to apply the datasource to a third group, you could simply edit the function, rather than editing the 3 separate datasources.