PRTG Manual: Sensor Factory Sensor
The Sensor Factory sensor monitors entire business processes that involve several components. You can create a customized sensor with channels based on data from other sensors ("source sensors").
If you want to create only a cumulated sensor status based on specific source sensors, we recommend that you use the Business Process sensor.
For a detailed list and descriptions of the channels that this sensor can show, see section Channel List.
- Dutch: Sensor Fabriek
- French: Capteur combiné
- German: Formelsensor
- Japanese: センサーファクトリ
- Portuguese: Sensor de fórmula
- Russian: Фабрика сенсоров
- Simplified Chinese: 传感器出厂
- Spanish: Sensor combinado
Consider the following remarks and requirements for this sensor:
Remark |
Description |
---|---|
Performance impact |
This sensor can have a very high impact on the performance of the PRTG core server system. We recommend that you use no more than 50 of this sensor per PRTG core server. |
Channels |
This sensor does not officially support more than 50 channels. |
Channel definitions |
This sensor does not support channel definitions that refer to channels of Sensor Factory sensors. |
Reports |
Uptime or downtime data for this sensor is not available in reports. |
Scanning interval |
Make sure that the scanning interval of this sensor is equal to or greater than the scanning interval of the source sensors to avoid incorrect sensor behavior. For example, "no data" messages or erratic changes of the sensor state can be a result of an invalid scanning interval. |
Flow sensors |
This sensor might not work with flow sensors. Sensors that use active flow timeout, for example NetFlow and jFlow sensors, are not supported by this sensor. |
Knowledge Base |
Knowledge Base: How can I monitor the overall status of the business process "email"? |
The sensor has the following default tags that are automatically predefined in the sensor's settings when you add the sensor:
- factorysensor
For more information about basic sensor settings, see section Sensor Settings.
Sensor Factory Specific Settings
Setting |
Description |
---|---|
Channel Definition |
Enter a channel definition for the Sensor Factory sensor. Using a specific syntax, you can refer to data from channels of other sensors. You can also calculate values. Enter one channel definition for each new channel that you want to add to the Sensor Factory sensor. For more information, see section Define Channels. |
Status Handling |
Define if the Sensor Factory sensor enters the Down status or to the Warning status if one of the source sensors is in the Down status:
|
Status Definition |
This setting is only visible if you select Use custom formula above. Define when the sensor switches to the Down status. You can use the status() function in combination with Boolean operations. For advanced users, it is also possible to calculate a status value. For more information, see section Define Sensor Status: status() Function. |
If a Source Sensor Has No Data |
Choose how this Sensor Factory sensor reacts if a source sensor referred to in the channel definition does not provide any data (for example, because it is set to the Paused status or does not exist):
If a sensor in the channel of a Sensor Factory sensor has no data, the Sensor Factory sensor always shows the Warning status, no matter which of the above options you select. |
Setting |
Description |
---|---|
Primary Channel |
Select a channel from the list to define it as the primary channel. In the device tree, PRTG displays the last value of the primary channel below the sensor's name. The available options depend on what channels are available for this sensor. You can set a different primary channel later by clicking below a channel gauge on the sensor's Overview tab. |
Graph Type |
Define how this sensor shows different channels:
|
Stack Unit |
This setting is only visible if you select Stack channels on top of each other above. Select a unit from the list. PRTG stacks all channels with this unit on top of each other. By default, you cannot exclude single channels from stacking if they use the selected unit. However, there is an advanced procedure to do so. |
By default, all of these settings are inherited from objects that are higher in the hierarchy. We recommend that you change them centrally in the root group settings if necessary. To change a setting for this object only, click under the corresponding setting name to disable the inheritance and to display its options.
For more information, see section Inheritance of Settings.
The channels of a Sensor Factory sensor are controlled by the Channel Definition text field. Using a special syntax, you can refer to other sensors' channels, calculate values, and add horizontal lines. You can define Sensor Factory channels using data from any other sensor's channels on your PRTG core server.
Make sure that no channel definitions refer to channels of Sensor Factory sensors.
Example You see a definition of two Sensor Factory sensor channels. Both use the channel() function that collects data from the channels of other sensors in your monitoring and displays them: #1:Local Probe Health The first channel of the Sensor Factory sensor (#1) collects data from the Health channel (ID 0) of the Probe Health sensor (ID 1001) running on the probe device. The second channel (#2) collects data from the Traffic Out channel (ID 1) of a traffic sensor (ID 1004) measuring the system's local network adapter. Both channels are shown together in the Sensor Factory sensor's data tables and graphs. |
The basic syntax for a Sensor Factory sensor channel definition looks like this:
#<id>:<name>[<unit>]
<formula>
For each channel, one section is used. A section begins with the number sign (#). Function names in formulas are not case-sensitive.
The parameters include the following:
- <id> is the ID of the Sensor Factory sensor's channel. It must be a unique number that is greater than 0.
- <name> is the name of the Sensor Factory sensor's channel (displayed in graphs and tables).
- [<unit>] is an optional unit description for the Sensor Factory sensor's channel (for example, bytes). If you do not provide a unit, the Sensor Factory sensor automatically selects a suitable unit string (recommended).
- <formula> contains the formula to calculate the Sensor Factory sensor's channel. For the formula, you can use the following functions: channel(), min(), max(), avg(), or percent().
Define Channels: channel() Function
The channel() function allows the Sensor Factory sensor to read the data from a channel of a source sensor. The syntax is:
channel(<sensorId>,<channelId>)
The parameters include the following:
- <sensorId> is the ID of the source sensor. It is displayed on the sensor's Overview tab.
- <channelId> is the ID of the channel of the source sensor. It is displayed in the respective field of the channel settings.
Example channel(2001,2) This function reads the data from channel ID 2 of the source sensor with the ID 2001. #1:Sample This full channel definition reads the data from channel ID 2 of the source sensor with the ID 2001 and displays it in the first Sensor Factory sensor channel (#1), without any additional calculations. |
Define Channels: Formula Calculations
Within a formula, the following elements are allowed to perform calculations with the values that are returned by one or more functions.
- Basic operations: + (add), - (subtract), * (multiply), / (divide)
Example: 3 + 5 * 2 - Parentheses: ( )
Example: 3 * (2 + 6) - Compare: = (equal), <> (not equal), > (greater), < (less), >= (greater or equal), <= (less or equal)
If the comparison resolves to true, the value is 10,000. If false, the value is 0. For delta sensors, the speed is compared.
Example You see a Sensor Factory sensor channel definition with calculation. #1:Traffic Total x Minus Traffic Out y This full channel definition results in a Sensor Factory sensor that shows a calculation with values from two channels (channel IDs -1 and 1) of two traffic sensors (sensor IDs 2001 and 1004). The returned values are subtracted and then multiplied by two. |
Channels can be gauge values (for example, ping ms) or delta values (for example, traffic kbit/s). Not all combinations are allowed in a formula.
When performing percentage calculation, use the percent() Function to make sure you obtain the expected values.
There are calculations you cannot do:
- You cannot add or subtract a delta from a gauge channel (and vice versa).
- You cannot multiply two delta channels.
- You cannot compare a delta with a gauge channel.
- You cannot use a channel of (another) Sensor Factory sensor channel in the formula.
Define Channels: min() and max() Functions
The min() and max() functions return the minimum or maximum of two values. The syntax is:
min(<a>,<b>)
max(<a>,<b>)
Values for <a> and <b> are either numbers or channel() functions.
Examples min(10,5) This function returns 5, because this is the smaller value out of 10 and 5. min( channel(2001,1),channel(2002,1) ) This function returns the minimum of the values of channel 1 of the source sensor with ID 2001 and channel 1 of the source sensor with ID 2002. |
Define Channels: avg() Function
The avg() function returns the average of the two values. This equals: (a+b) / 2. The syntax is:
avg(<a>,<b>)
Values for <a> and <b> are either numbers or channel() functions.
Examples avg(20,10) This function returns 15: (20+10) / 2 = 15. avg( channel(2001,1),channel(2002,1) ) This function returns the average of channel 1 of the source sensor with ID 2001 and channel 1 of the source sensor with ID 2002. |
Define Channels: percent() Function
The percent() function calculates the percent value of two specified values, for example, a channel and a fixed value. The syntax is:
percent(<source>,<maximum>,<unit>)
The parameters include the following:
- <source> is the value the percent is calculated for. This is usually a channel() function.
- <maximum> is the limit value used for the percent calculation.
- <unit> is an optional unit the maximum is provided in. You can use constants with this function (see Define Channels: Constants below for a list). This can be used for absolute values (for example, Ping sensors) or calculated delta values (for example, traffic sensors). If no unit is provided, 1 is used.
The sensor adds the unit string % automatically.
PRTG calculates: <source> / <maximum> * <unit> * 100
Examples #1:Usage Traffic In This full channel definition results in a Sensor Factory sensor that shows two channels of a traffic sensor (sensor ID 2001): Traffic in (channel ID 0) and traffic out (channel ID 1). The Sensor Factory sensor displays the values % of maximum bandwidth (100 kilobit/second). #1:Ping % This full channel definition results in a Sensor Factory sensor that shows the Ping Time channel (channel ID 0) of a Ping sensor (sensor ID 2002). The sensor displays the values as a percentage of 200 ms. |
Define Channels: Horizontal Lines
You can add lines to the graph using a formula without the channel() function. Use a fixed value instead. The syntax is:
#<id>:<name>[<unit>]
<value>
The parameters include the following:
- <id> is the ID of the Sensor Factory sensor's channel and must be a unique number greater than 1. Although the Sensor Factory sensor does not show a horizontal line as a channel, the ID has to be unique.
- <name> is the name of the Sensor Factory sensor's channel. PRTG does not display this name in graphs and tables, but you can use it as a comment to describe the nature of the line.
- [<unit>] is an optional unit description (for example, kbit/s). If you do not provide a unit, PRTG automatically applies the line to the scale of the first Sensor Factory sensor's channel. If your Sensor Factory sensor uses different units, provide a unit to make sure the line is added for the right scale. Enter the unit exactly as shown in your graph's legend. If you enter a unit that does not yet exist in your graph, a new scale is added automatically.
- <value> contains a number defining where the line is shown in the graph.
Examples #5:Line at 100ms [ms] This channel definition results in a graph that shows a horizontal line at the value of 100 on the ms scale. #6:Line at 2 Mbit/s [kbit/s] This channel definition results in a graph that shows a horizontal line at the value of 2000 on the kbit/s scale. #1:Ping Time This full channel definition results in a Sensor Factory sensor that shows the Ping Time channel (channel ID 0) of a Ping sensor (sensor ID 2002). Additionally, the sensor graphs show a horizontal line at 120 ms. |
The following constants are defined and can be used in calculations:
- one = 1
- kilo = 1000
- mega = 1000 * kilo
- giga = 1000 * mega
- tera = 1000 * giga
- byte = 1
- kilobyte = 1024
- megabyte = 1024 * kilobyte
- gigabyte = 1024 * megabyte
- terabyte = 1024 * gigabyte
- bit = 1/8
- kilobit = kilo / 8
- megabit = mega / 8
- gigabit = giga / 8
- terabit = tera / 8
Define Sensor Status: status() Function
You can control the status of a Sensor Factory sensor via the Status Definition text field if you enable the custom formula option in the sensor settings. Using a special syntax, you can define when the Sensor Factory sensor changes to the Down status. In all other cases, the sensor is in the Up status. The syntax is:
status(sensorID) <boolean> status(sensorID)
The parameters include the following:
- <sensorId> is the ID of the source sensor that you want to check the status of. It is displayed on the sensor's Overview tab.
- <boolean> is one of the Boolean operators AND, OR, or NOT. If the resulting expression is true, the Sensor Factory sensor changes to the Down status.
Examples status(2031) AND status(2044) This changes the Sensor Factory sensor to the Down status if both source sensors, with IDs 2031 and 2044, are in the Down status. Otherwise the Sensor Factory sensor shows the Up status. status(2031) OR status(2044) This changes the Sensor Factory sensor to the Down status if at least one of the source sensors with ID 2031 or ID 2044 is in the Down status. Otherwise the Sensor Factory sensor shows the Up status. status(2031) AND NOT status(2044) This changes the Sensor Factory sensor to the Down status if the source sensor with ID 2031 is in the Down status, but the source sensor with ID 2044 is not in the Down status. Otherwise the Sensor Factory sensor shows the Up status. A status() function with NOT has to be connected with AND or OR if it is combined with other status() functions: status(sensorID) AND NOT status(sensorID)
( status(2031) AND status(2044) ) OR status(2051) This changes the Sensor Factory sensor to the Down status if both the source sensor with ID 2031 and the source sensor with ID 2044 are in the Down status, or if the source sensor with ID 2051 is in the Down status. Otherwise the Sensor Factory sensor shows the Up status. |
Additionally, the following elements are allowed to perform calculations and comparisons with the values that are returned by the status functions:
- Basic operations: + (add), - (subtract), * (multiply), / (divide)
Example: 3 + 5 * 2 - Parentheses: ( )
Example: 3 * (2 + 6) - Compare: = (equal), <> (not equal), > (greater), < (less), >= (greater or equal), <= (less or equal)
If the comparison resolves to true, the value is 10,000. If false, the value is 0. For delta sensors, the speed is compared.
Internally, the status() function returns the Downtime channel of the source sensor in hundreds of percent (10,000 = 100%).
- true corresponds to a value of 10,000, which is the Down status.
- false corresponds to a value of 0, which is the Up status.
If you understand this, you can use more complex formulas.
Example ( status(1031) + status(1032) + status(1033) + status(1034) ) >= 20000 This changes the Sensor Factory sensor to the Down status if at least any two of the source sensors with IDs 1031, 1032, 1033, or 1034 are in the Down status. Otherwise the Sensor Factory sensor shows the Up status. |
You can also use the status() function in channel definitions. Using this functionality, it is possible, for example, to display the numeric status value of source sensors in a Sensor Factory sensor channel.
Using Sensor Factory Sensors in a Cluster
If you run PRTG in a failover cluster, note the following:
- If you add a Sensor Factory sensor underneath the cluster probe, and in the Sensor Factory formula you refer to a channel of a source sensor running on the cluster probe as well, the Sensor Factory sensor shows the data of all cluster nodes for this channel.
- If you add a Sensor Factory sensor underneath the local probe, and in the Sensor Factory formula you refer to a channel of a sensor running on the cluster probe, the Sensor Factory sensor only shows data of the primary master node for this channel.
Which channels the sensor actually shows might depend on the target device, the available components, and the sensor setup.
Channel |
Description |
---|---|
[Custom] |
The monitoring results from other sensors or devices. Samples for usage are:
|
Downtime |
In the channel table on the Overview tab, this channel never shows any values. PRTG uses this channel in graphs and reports to show the amount of time in which the sensor was in the Down status The Sensor Factory sensor does not show values in the Downtime channel because they cannot be calculated for this sensor. |
KNOWLEDGE BASE
How can I monitor the overall status of the business process "email"?
What security features does PRTG include?
Can you help me understand when the Sensor Factory sensor changes to the down status and why?
What can I do with the Sensor Factory sensors of PRTG?
VIDEO TUTORIAL
Sensor Factory sensor