How DataSources Get Applied to Resources
IN THIS ARTICLE:
DataSources define what numeric time-series data should be collected for the various resources you would like to monitor (e.g. device, application, database, cloud account, etc.). In addition to defining the type of data that is collected, DataSources also define how that data is collected, and what constitutes alert conditions.
LogicMonitor installs with more than a thousand pre-configured DataSources to allow you to instantly begin monitoring the majority of your infrastructure. Some of these DataSources get applied across your infrastructure very broadly (e.g. the WinCPU DataSource is potentially applied to any resource identified as having a Microsoft Windows-based operating systems) while some target very specific entities (e.g. the Barracuda Mail Filter DataSource is applied only to systems with the Barracuda Spam Firewall).
But what determines how DataSources are applied? LogicMonitor has created a process that, with few exceptions, automatically applies the relevant DataSources to the resources that you have made available for monitoring.
This automated process kicks off when resources are added into monitoring (see Adding Devices for more information on adding resources into monitoring) and consists of the following general steps:
- Property Assignment
- Evaluation of AppliesTo logic in DataSource
- Instance discovery
- Data collection
Each of these steps is discussed in detail in the following sections.
When a resource is added into monitoring, LogicMonitor immediately runs a series of queries using WMI and SNMP to determine basic system information about the resource such as operating system version, IP address, sysOID, supported SNMP version, system category, and so on. This information is stored as properties that are associated with the resource (e.g. the system.ips property stores IP address).
Once basic system information has been determined and assigned to a resource, it's likely that one or more PropertySources will assign further properties to the resource. PropertySources are LogicModules that auto-assign properties at the resource level based on the output of a Groovy or PowerShell script. For example, if you've just added a resource into monitoring that is identified as having a Windows- or Linux-based operating system, the addCategory_MSSQL PropertySource, which is configured to run for all Linux or Windows hosts, will query the resource to see if it is running Microsoft SQL Server and, if it is, assign a value of "MSSQL" to the system.categories property.
There can be up to a 24-hour delay before PropertySources are automatically matched to a newly-added resource. However, as discussed in Creating PropertySources, there are ways to manually initiate PropertySource association.
Note: Properties can also be manually assigned to resources.
For more information on the mechanisms LogicMonitor uses to automatically assign properties to a resource (or on the process of manually assigning properties), see Resource and Instance Properties.
Evaluation of DataSource AppliesTo Logic
The properties assigned to the resource (as automatically set by LogicMonitor or manually set by you) are then used by DataSources to determine which DataSources are associated with the resource. Specifically, the Applies To field found in DataSource definitions is evaluated. The expression in this field designates which properties the DataSource should evaluate; if the expression in this field evaluates to TRUE, then the DataSource is applied to the resource. For example, continuing with the example in the previous section, the SQL Server Troubleshooter DataSource applies to any resource that has a value of "MSSQL" in its system.categories property. For more information on LogicMonitor's AppliesTo scripting language, see What Is AppliesTo Scripting?.
Evaluation of the AppliesTo scripting expressions found in DataSources takes place whenever a resource's properties are added or updated; LogicMonitor reevaluates all DataSources against the updated properties to see if any additional DataSources should be applied to the resource—or any existing DataSources should be removed from the resource. Similarly, if a DataSource's AppliesTo expression changes, LogicMonitor reevaluates all resources and their properties according to the new AppliesTo expression. This process is automated, but can be forced for a specific resource by manually initiating Active Discovery, as discussed in Active Discovery.
All DataSources applied to a resource that identify at least one instance to monitor are listed in the Resources tree as children of the resource. It's possible to have DataSources that apply to a resource based on the resource's properties, but that don't actually locate an instance to monitor; in those cases, the DataSource does not display in the Resources tree.
Note: In addition to viewing the applied DataSources from the Resources tree, you can also see all resources a DataSource applies to from the DataSource definition by selecting More | Show associated devices.
Once a DataSource applies to a resource, instance(s) are discovered for the resource and data collection begins. Some DataSources will only ever have one one instance to monitor per device (e.g. ping), while others may identify multiple instances (e.g. disks, server volumes, interfaces, etc.) to monitor per device.
For single-instance DataSources, the instance is automatically added and data collection begins immediately. For multi-instance DataSources, the Active Discovery process must be enabled and execute in order for all applicable instances to be identified for the resource (or, as an alternative, instances need to be added manually). For more information on Active Discovery or manually adding instances, see Active Discovery and Adding Instances respectively.
Once instance(s) are identified, data collection begins. For multi-instance DataSources, you can see data on a per-instance basis as well as on an aggregated basis. As overviewed in Navigating the Resources Page, the data that is collected by a DataSource can be viewed from the Resources page, in raw form or graph form, along with alerts that have been raised and other pertinent information.