<%NUMBERING1%>.<%NUMBERING2%>.<%NUMBERING3%> 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").

i_round_blueIf you want to create only a cumulated sensor status based on specific source sensors, we recommend that you use the Business Process sensor.

Sensor Factory Sensor

Sensor Factory Sensor

i_square_cyanFor a detailed list and descriptions of the channels that this sensor can show, see section Channel List.

Sensor in Other Languages

  • Dutch: Sensor Fabriek
  • French: Capteur combiné
  • German: Formelsensor
  • Japanese: センサーファクトリ
  • Portuguese: Sensor de fórmula
  • Russian: Фабрика сенсоров
  • Simplified Chinese: 传感器出厂
  • Spanish: Sensor combinado

Remarks

  • 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.
  • This sensor does not officially support more than 50 channels.

Basic Sensor Settings

Basic Sensor Settings

Basic Sensor Settings

Setting

Description

Sensor Name

Enter a name to identify the sensor. By default, PRTG shows this name in the device tree, as well as in alarms, logs, notifications, reports, maps, libraries, and tickets.

i_round_blueIf the name contains angle brackets (<>), PRTG replaces them with braces ({}) for security reasons. For more information, see the Knowledge Base: What security features does PRTG include?

Parent Tags

The tags that the sensor inherits from its parent device, parent group, and parent probe.

i_round_blueThis setting is for your information only. You cannot change it.

Tags

Enter one or more tags. Confirm each tag with the Spacebar key, a comma, or the Enter key. You can use tags to group objects and use tag-filtered views later on. Tags are not case-sensitive. Tags are automatically inherited.

i_round_blueIt is not possible to enter tags with a leading plus (+) or minus (-) sign, nor tags with parentheses (()) or angle brackets (<>).

i_round_blueFor performance reasons, it can take some minutes until you can filter for new tags that you added.

The sensor has the following default tags that are automatically predefined in the sensor's settings when you add the sensor:

  • factorysensor

Priority

Select a priority for the sensor. This setting determines the position of the sensor in lists. The highest priority is at the top of a list. Choose from the lowest priority (i_priority_1) to the highest priority (i_priority_5).

Sensor Factory Specific Settings

Sensor Factory Specific 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.

i_square_cyanFor more information, see section Define Channels.

Status Handling

Define the behavior of the Sensor Factory sensor if one of the source sensors is in the Down status. In this case, you can set the Sensor Factory sensor either to the Down status or to the Warning status.

  • Show down status when one or more source sensors are in the down status: If at least one source sensor that you use in a channel definition is in the Down status, the Sensor Factory sensor shows the Down status as well until all referred sensors leave this status. While the Sensor Factory sensor is in the Down status, it still shows data of all available channels.
    i_round_blueIf a lookup definition or an error limit triggers the Down status of the source sensor, the Sensor Factory does not show the Down status. This is because the Sensor Factory should only show this status if it cannot calculate values.
  • Show warning status when one or more source sensors are in the down status: If at least one source sensor that you use in a channel definition is in the Down status, the Sensor Factory sensor shows the Warning status until all referred sensors leave the Down status.
    i_round_blueIf a lookup definition or an error limit triggers the Down status of the source sensor, the Sensor Factory does not show the Warning status. This is because the Sensor Factory sensor should only show this status if it cannot calculate values.
  • Use custom formula: Define the status of the Sensor Factory sensor by adding a Status Definition below.

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.

i_square_cyanFor 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):

  • Do not calculate the channels that use the sensor: For defined channels that use one or more sensors that deliver no data, no data is shown.
  • Calculate the channels and use zero as source value: If a source sensor that you use in a channel definition does not deliver any data, zero values are filled in instead. The Sensor Factory sensor calculates the channel value and shows it using these zero values.

i_round_redIf 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.

Sensor Display

Sensor Display

Sensor Display

Setting

Description

Primary Channel

Select a channel from the list to define it as the primary channel. In the device tree, the last value of the primary channel is always displayed below the sensor's name. The available options depend on what channels are available for this sensor.

i_round_blueYou can set a different primary channel later by clicking b_channel_primary below a channel gauge on the sensor's Overview tab.

Graph Type

Define how different channels are shown for this sensor:

  • Show channels independently (default): Show a graph for each channel.
  • Stack channels on top of each other: Stack channels on top of each other to create a multi-channel graph. This generates a graph that visualizes the different components of your total traffic.
    i_round_redYou cannot use this option in combination with manual Vertical Axis Scaling (available in the channel settings).

Stack Unit

This setting is only visible if you select Stack channels on top of each other above.

Select a unit from the list. All channels with this unit are stacked 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.

Inherited Settings

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 b_inherited_enabled under the corresponding setting name to disable the inheritance and to display its options.

i_square_cyanFor more information, see section Inheritance of Settings.

Scanning Interval

Scanning Interval

Scanning Interval

i_square_cyanFor more information, see section Root Group Settings, section Scanning Interval.

Schedules, Dependencies, and Maintenance Window

i_round_blueYou cannot interrupt the inheritance for schedules, dependencies, and maintenance windows. The corresponding settings from the parent objects are always active. However, you can define additional schedules, dependencies, and maintenance windows. They are active at the same time as the parent objects' settings.

Schedules, Dependencies, and Maintenance Window

Schedules, Dependencies, and Maintenance Window

i_square_cyanFor more information, see section Root Group Settings, section Schedules, Dependencies, and Maintenance Window (default).

Access Rights

Access Rights

Access Rights

i_square_cyanFor more information, see section Root Group Settings, section Access Rights.

Define Channels

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.

i_round_blueMake sure that no channel definitions refer to channels of Sensor Factory sensors.

i_speechExample

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
channel(1001,0)
#2:Local Traffic Out[kbit]
channel(1004,1)

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 card. 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 are:

  • <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 are:

  • <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.

i_speechExample
 

channel(2001,2)

This function reads the data from channel ID 2 of the source sensor with the ID 2001.
 

#1:Sample
channel(2001,2)

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.

i_speechExample

You see a Sensor Factory sensor channel definition with calculation.

#1:Traffic Total x Minus Traffic Out y
( channel(2001,-1) - channel(1004,1) ) * 2

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.

i_round_redWhen 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.

i_speechExamples
 

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.

i_speechExamples
 

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 are:

  • <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.
    i_round_blueThe sensor adds the unit string % automatically.

PRTG calculates: <source> / <maximum> * <unit> * 100

i_speechExamples
 

#1:Usage Traffic In
percent(channel(2001,0),100,kilobit)
#2:Usage Traffic Out
percent(channel(2001,1),100,kilobit)

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 %
percent(channel(2002,0),200)

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 are:

  • <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.

i_speechExamples
 

#5:Line at 100ms [ms]
100

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]
2000

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
channel(2002,0)
#2:Line at 120ms [ms]
120

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.

Define Channels: Constants

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 are:

  • <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.

i_speechExamples
 

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.

i_round_blueA 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(sensorID) OR 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.

i_speechExample
 

( 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.

i_round_redYou 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.

Channel List

i_round_blueWhich 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:

  • Show single channels of one or more sensors in one graph.
  • Use the data from single channels of one or more sensors to calculate new values (for example, you can subtract, multiply, and divide).
  • Create graphs with data from other sensors' channels and add horizontal lines at specific vertical positions.

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

i_round_blueThe Sensor Factory sensor does not show values in the Downtime channel because they cannot be calculated for this sensor.

More

i_square_blueKNOWLEDGE 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?

 

i_playVIDEO TUTORIAL

Sensor Factory sensor