<%NUMBERING1%>.<%NUMBERING2%>.<%NUMBERING3%> PRTG Manual: Sensor Factory Sensor
The Sensor Factory sensor is a powerful tool that allows you to monitor entire business processes that involve several components.
You can define one or more channels that combine monitoring results from other sensors or devices. You can create your own individual sensor with channels based on data 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 sensor channels and add horizontal lines at specific vertical positions.
The Sensor Factory sensor does not show values in the Downtime channel because they cannot be calculated for this sensor type.
If you want to create only a cumulated sensor status based on specific source sensors, we recommend that you use the Business Process Sensor instead.
Which channels the sensor actually shows might depend on the monitored device and the sensor setup.
Sensor Factory Sensor
Click here to enlarge: http://media.paessler.com/prtg-screenshots/sensor_factory.png
Remarks
Limited to 50 Sensor Channels
PRTG does not support more than 50 sensor channels officially. Depending on the data used with this sensor type, you might exceed the maximum number of supported sensor channels. In this case, PRTG will try to display all sensor channels. However, please be aware that you will experience limited usability and performance.
Add Sensor
The Add Sensor dialog appears when you manually add a new sensor to a device. It only shows the setting fields that are required for creating the sensor. Therefore, you will not see all setting fields in this dialog. You can change (nearly) all settings in the sensor's Settings tab later.
Sensor Settings
On the details page of a sensor, click the Settings tab to change its settings.
Usually, a sensor connects to the IP Address or DNS Name of the parent device where you created this sensor. See the Device Settings for details. For some sensor types, you can define the monitoring target explicitly in the sensor settings. Please see below for details on available settings.
|
Sensor Name
|
Enter a meaningful 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.
|
Parent Tags
|
Shows Tags that this sensor inherits from its parent device, group, and probe. This setting is shown for your information only and cannot be changed here.
|
Tags
|
Enter one or more Tags, separated by spaces or commas. You can use tags to group sensors and use tag–filtered views later on. Tags are not case sensitive. We recommend that you use the default value.
You can add additional tags to the sensor if you like. Other tags are automatically inherited from objects further up in the device tree. These are visible above as Parent Tags.
|
Priority
|
Select a priority for the sensor. This setting determines where the sensor is placed in sensor lists. Top priority is at the top of a list. Choose from one star (low priority) to five stars (top priority).
|
|
Channel Definition
|
Enter a channel definition for the sensor. Using a specific syntax, you can refer to data from channels of other sensors here. You can also calculate values. Enter one channel definition for each new channel you want to add to this sensor. Please see section Define Sensor Channels below.
|
Error Handling
|
Define the behavior of the sensor if one of the sensors defined above is in an error status. In this case, you can set the sensor factory sensor either to down or to warning status. Choose between:
- Factory sensor shows error status when one or more source sensors are in error status: If at least one sensor that you use in a channel definition is in a Down status, the Factory sensor shows a Down status as well until all referred sensors leave this status. While the Sensor Factory sensor is Down, it will still show data of all available sensor channels.
If a lookup definition or an error limit triggers the error status of the source sensor, the Sensor Factory will not show a Down status. This is because the Sensor Factory should only show this status if it cannot calculate values.
- Factory sensor shows warning status when one or more source sensors are in error status: If at least one sensor that you use in a channel definition is in a Down status, the factory sensor shows a Warning status until all referred sensors leave the Down status.
If a lookup definition or an error limit triggers the error status of the source sensor, the Sensor Factory will not show a Warning status. This is because the Sensor Factory should only show this status if it cannot calculate values.
- Use custom formula: Define the status of the Factory sensor by adding a status definition in the field below.
|
Status Definition
|
This field is only visible if you choose Use custom formula above. Define when the sensor will switch to a 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. Please see section Define Sensor Status below.
|
If a Sensor Has No Data
|
Choose how this Sensor Factory sensor reacts if a sensor referred to in the channel definition does not provide any data (for example, because it is paused or does not exist). Choose between:
- Do not calculate factory channels that use the sensor: For defined channels that use one or more sensor(s) that deliver no data, no data is shown. Additionally, the factory sensor shows a Warning status.
- Calculate the factory channels and use zero as source value: If a sensor that you use in a channel definition does not deliver any data, zero values will be filled in instead. The sensor factory calculates the channel value and shows it using these zero values.
|
|
Primary Channel
|
Overview
|
Graph Type
|
Define how different channels will be shown for this sensor.
- Show channels independently (default): Show an own 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 will generate an easy-to-read graph that visualizes the different components of your total traffic.
This option cannot be used in combination with manual Vertical Axis Scaling (available in the Sensor Channels Settings settings).
|
Stack Unit
|
This setting is only available if stacked graphs are selected above. Choose a unit from the list. All channels with this unit will be 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 following settings are inherited from objects higher in the hierarchy and should be changed there, if necessary. Often, best practice is to change them centrally in the Root group's settings. To change a setting only for this object, disable inheritance by clicking the check mark in front of the corresponding setting name. You will then see the options described below.
|
Scanning Interval
|
Select a scanning interval (seconds, minutes, or hours) from the list. The scanning interval determines the time the sensor waits between two scans. You can change the available intervals in the system administration on PRTG on premises installations.
|
If a Sensor Query Fails
|
Define the number of scanning intervals that a sensor has time reach and check a device again in case a sensor query fails. The sensor can try to re-reach and check a device several times, depending on the option you select here, before it will be set to a Down status. This helps you avoid false alarms if the monitored device has only temporary issues. For previous scanning intervals with failed requests, the sensor will show a Warning status. Choose between:
- Set sensor to "down" immediately: The sensor will show an error immediately after the first failed request.
- Set sensor to "warning" for 1 interval, then set to "down" (recommended): After the first failed request, the sensor will show a yellow warning status. If the following request also fails, the sensor will show an error.
- Set sensor to "warning" for 2 intervals, then set to "down": Show an error status only after three continuously failed requests.
- Set sensor to "warning" for 3 intervals, then set to "down": Show an error status only after four continuously failed requests.
- Set sensor to "warning" for 4 intervals, then set to "down": Show an error status only after five continuously failed requests.
- Set sensor to "warning" for 5 intervals, then set to "down": Show an error status only after six continuously failed requests.
Sensors that monitor via Windows Management Instrumentation (WMI) always wait at least one scanning interval until they show an error. It is not possible to set a WMI sensor to "down" immediately, so the first option will not apply to these sensor types. All other options can apply.
If a sensor has defined error limits for channels, it will always show a Down status immediately, so no "wait" option will apply.
If a channel uses lookup values, it will always show a Down status immediately, so no "wait" options will apply.
|
|
Inheritance for schedules, dependencies, and maintenance windows cannot be interrupted. The corresponding settings from the parent objects will always be active. However, you can define additional settings here. They will be active at the same time as the parent objects' settings.
|
Schedule
|
Select a schedule from the list. Schedules can be used to monitor for a certain time span (days, hours) every week. With the period list option it is also possible to pause monitoring for a specific time span. You can create new schedules and edit existing ones in the account settings.
Schedules are generally inherited. New schedules will be added to existing ones, so all schedules are active at the same time.
|
Maintenance Window
|
- Not set (monitor continuously): No maintenance window will be set and monitoring will always be active.
- Set up a one-time maintenance window: Pause monitoring within a maintenance window. You can define a time span for a monitoring pause below and change it even for a currently running maintenance window.
To terminate a current maintenance window before the defined end date, change the time entry in Maintenance Ends field to a date in the past.
|
Maintenance Begins
|
This field is only visible if you enabled the maintenance window above. Use the date time picker to enter the start date and time of the maintenance window.
|
Maintenance Ends
|
This field is only visible if you enabled the maintenance window above. Use the date time picker to enter the end date and time of the maintenance window.
|
Dependency Type
|
Define a dependency type. Dependencies can be used to pause monitoring for an object depending on the status of another. You can choose between:
- Use parent: Pause the current sensor if the device, where it is created on, is in Down status, or is paused by another dependency.
- Select object: Pause the current sensor if the device, where it is created on, is in Down status, or is paused by another dependency. Additionally, pause the current sensor if a specific other object in the device tree is in Down status, or is paused by another dependency. Select below.
- Master object for parent: Make this sensor the master object for its parent device. The sensor will influence the behavior of the device, where it is created on: If the sensor is in Down status, the device will be paused. For example, it is a good idea to make a Ping sensor the master object for its parent device to pause monitoring for all other sensors on the device in case the device cannot even be pinged. Additionally, the sensor will be paused if the parent group of its parent device is in Down status, or if it is paused by another dependency.
Testing your dependencies is easy! Simply choose Simulate Error Status from the context menu of an object that other objects depend on. A few seconds later all dependent objects should be paused. You can check all dependencies in your PRTG installation by selecting Devices | Dependencies from the main menu bar.
|
Dependency
|
This field is only visible if the Select object option is enabled above. Click on the reading-glasses and use the object selector to choose an object on which the current sensor will depend.
|
Dependency Delay (Sec.)
|
Define a time span in seconds for a dependency delay. After the master object for this dependency goes back to Up status, PRTG will start monitoring the depending objects after this extra delayed. This can help to avoid false alarms, for example, after a server restart, by giving systems more time for all services to start up. Please enter an integer value.
This setting is not available if you choose this sensor to Use parent or to be the Master object for parent. In this case, please define delays in the parent Device Settings or in the superior Group Settings.
|
|
User Group Access
|
Define which user group(s) will have access to the object you're editing. A table with user groups and types of access rights is shown: It contains all user groups from your setup. For each user group you can choose from the following access rights:
- Inherited: Use the access rights settings of the parent object.
- None: Users in this group cannot see or edit the object. The object neither shows up in lists nor in the device tree. Exception: If a child object is visible to the user, the object is visible in the device tree, though not accessible.
- Read: Users in this group can see the object and review its monitoring results.
- Write: Users in this group can see the object, review its monitoring results, and edit the object's settings. They cannot edit access rights settings.
- Full: Users in this group can see the object, review its monitoring results, edit the object's settings, and edit access rights settings.
You can create new user groups in the System Administration—User Groups settings. To automatically set all objects further down in the hierarchy to inherit this object's access rights, set a check mark for the Revert children's access rights to inherited option.
For more details on access rights, please see the section User Access Rights.
|
Define Sensor 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 sensor channels, calculate values, and add horizontal lines. You can define factory sensor channels using data from any other sensor's channels on your PRTG server.
Example
You see a definition of two factory sensor channels. Both use the channel() function which simply 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 factory sensor (#1) collects data from the Health channel (ID 0) of the Probe Health sensor (ID 1001) running on the Local 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 will be shown together in the factory sensor's data tables and graphs.
|
The basic syntax for a sensor factory channel definition looks like this:
#<id>:<name>[<unit>]
<formula>
For each channel one section is used. A section begins with the # sign. Function names in formulas are not case sensitive.
The parameters are:
- <id> is the ID of the factory sensor's channel and must be a unique number > 0.
- <name> is the name of the factory sensor's channel (displayed in graphs and tables).
- [<unit>] is an optional unit description for the factory sensor's channel (for example, bytes). If you do not provide a unit, the sensor factory selects a suitable unit string automatically (recommended).
- <formula> contains the formula to calculate the factory sensor's channel. For the formula, you can use the following functions: channel(), min(), max(), avg(), or percent().
Define Sensor 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), - (substract), * (multiply), / (divide)
Example: 3 + 5 * 2
- Brackets: ( )
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 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 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, please use the percent() Function to make sure you obtain the expected values!
There are calculations you cannot do:
- You cannot add/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 Sensor Channels—channel() Function
The channel() function allows to read the data from a channel of a different sensor. The syntax is:
channel(<sensorId>,<channelId>)
The parameters are:
- <sensorId> is the ID of the sensor. It is displayed on the sensor details page in the page header bar.
- <channelId> is the ID of the sensor channel. 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 sensor with the ID 2001.
#1:Sample
channel(2001,2)
This full channel definition reads the data from channel ID 2 of the sensor with the ID 2001 and displays it in the first factory sensor channel (#1), without any additional calculations.
|
Define Sensor 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 in the first line 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 sensor with ID 2001 and channel 1 of the sensor with ID 2002.
|
Define Sensor 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 sensor with ID 2001 and channel 1 of the sensor with ID 2002.
|
Define Sensor Channels—percent() Function
The percent() function calculates the percent value of two given 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 Constants section below for a list). This can be used for gauge (for example, Ping sensors) or delta (for example, traffic sensors). If no unit is provided, 1 will be used.
The sensor adds the unit string % automatically.
PRTG will calculate: <source> / <maximum> * <unit> * 100
Examples
#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 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 displays the values % of maximum bandwidth (100 kilobit/second).
#1:Ping %
percent(channel(2002,0),200)
This full channel definition results in a 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 Sensor Channels—Horizontal Lines
You can add lines to the graph using a formula without channel() function. Use a fixed value instead. The syntax is:
#<id>:<name>[<unit>]
<value>
The parameters are:
- <id> is the ID of the factory sensor's channel and must be a unique number > 1. Although the sensor does not show a horizontal line as a channel, the ID has to be unique.
- <name> is the name of the 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 applies the line automatically to the scale of the first factory sensor channel. If your 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 will be added automatically.
- <value> contains a number defining where the line will be shown in the graph.
Examples
#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 factory sensor that shows the Ping Time channel (channel ID 0) of a Ping sensor (sensor ID 2002). Additionally, the sensor graphs will show a horizontal line at 120 ms.
|
Define Sensor 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
The status of a Sensor Factory sensor can be controlled by 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 factory sensor changes to a Down status. In all other cases, the sensor will be in an Up status. The syntax is:
status(sensorID) <boolean> status(sensorID)
The parameters are:
- <sensorId> is the ID of the sensor you want to check the status of. It is displayed on the sensor details page in the page header bar.
- <boolean> is one of the Boolean operators AND, OR, or NOT. If the resulting expression is true, the factory sensor will change to a Down status.
Examples
status(2031) AND status(2044)
This changes the factory sensor to a Down status if both sensors, with IDs 2031 and 2044, are Down. Otherwise the factory sensor shows an Up status.
status(2031) OR status(2044)
This changes the factory sensor to a Down status if at least one of the sensors with ID 2031 or ID 2044 is Down. Otherwise the factory sensor shows an Up status.
status(2031) AND NOT status(2044)
This changes the factory sensor to a Down status if the sensor with ID 2031 is Down, but the sensor with ID 2044 is not in a Down status. Otherwise the factory sensor shows an 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(sensorID) OR NOT status(sensorID)
( status(2031) AND status(2044) ) OR status(2051)
This changes the factory sensor to a Down status if both the sensor with ID 2031 and the sensor with ID 2044 is Down, or if the sensor with ID 2051 is Down. Otherwise the factory sensor shows an 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), - (substract), * (multiply), / (divide)
Example: 3 + 5 * 2
- Brackets: ( )
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 sensor in hundreds of percent (10,000 = 100%).
- true corresponds to a value of 10,000 which is a Down status.
- false corresponds to a value of 0 which is an Up status.
If you understand this, you are able to use more complex formulas.
Example
( status(1031) + status(1032) + status(1033) + status(1034) ) >= 20000
This changes the factory sensor to a Down status if at least any two of the sensors with IDs 1031, 1032, 1033, or 1034 are Down. Otherwise the factory sensor shows an 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 sensors in a factory sensor channel.
Using Factory Sensors in a Cluster Setup
If you run PRTG in Clustering mode, please note these additional facts:
- If you add a Sensor Factory sensor underneath the Cluster Probe, and in the Sensor Factory formula you refer to a channel of a sensor running on the Cluster Probe as well, the Sensor Factory sensor shows the data of all cluster nodes for this sensor 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 sensor channel.
More
Video Tutorial: How to Create a Factory Sensor for the Monitoring of Complex Processes in PRTG
Knowledge Base: How can I monitor the overall status of the business process "Email"?
Knowledge Base: Can I add sensors to Sensor Factory sensors using tags?
Knowledge Base: What can I do with PRTG's Sensor Factory Sensors?
Paessler Blog: Monitoring Business Processes—Transformation of Technical Outages to the Real Business Impact
Edit Sensor Channels
To change display settings and limits, switch to the sensor's Overview tab and click the gear icon of a specific channel. For detailed information, please see the Sensor Channels Settings.
Notifications
Click the Notifications tab to change notification triggers. For detailed information, please see the Sensor Notifications Settings section.
Others
For more general information about settings, please see the Object Settings section.
Sensor Settings Overview
For information about sensor settings, please see the following sections: