Collector

The collector receives messages from the server which contain the details of the device it should connect to, including its credentials. As a first step, the collector interrogates the device, to determine what it is. The result of this interrogation process is a set of tags describing the device. Once the interrogation phase is done, the collector will continue to run all "monitoring" commands repeatedly, collecting data from the device and parsing it into metrics.

Interrogation

In the platform's data model, each device has tags. These tags can include "device-id", which is a unique identifier for a device, as well as others. The tags describe the device and give us extra information about it. The process of generating these tags occurs only during interrogation. If a device is changed later, for example by updating the software running on it, the collector will throw away everything it knows about the device and will restart interrogation.

Let us consider a device called ACME Humidifier 2140. This device is connected to the enterprise's network, has an IP address and is accessible through both a REST API (available over HTTP and HTTPS) and an SSH connection. The collector was provided with the IP address, name and credentials for this device.

The collector has no idea that the ACME Humidifier is the specific device available at the IP address it received. So it needs to determine what's actually there. It will first run all interrogation commands that have no requirements and collect the first set of tags. Based on those tags, it will run other interrogation commands that require them. It will continue to do so until all interrogation commands are done and the tags are collected. See a sample of interrogation commands and their outputs for the ACME Humidifier.

If we lose connectivity to a device, we will restart the interrogation once we re-establish connectivity. We will essentially delete all the tags we have for the device and start over.

Monitoring

Once a device has been interrogated, the collector will load all the monitoring commands (those of type "monitoring") whose requirements are met for the device (based on the "requires" directive of the monitoring script). See sample scripts here.

The scripts will be run repeatedly, according to their interval. The metrics generated will be sent off to the server for storage in the DB. Prior to sending to the server, the collector attaches the device-id and collection timestamp to each metric. In some cases, a single monitoring script can generate several thousand metrics.