SQL Query File
|
Shows the SQL script file that is executed on the server. Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Use Input Parameter
|
Define if you want to pass a parameter to your SQL query file:
- Don't use input parameter (default): Execute the SQL query file without using variables.
- Use input parameter: Execute an SQL query file that contains a variable. Provide the parameter that you want to use in the query below.
Passing a parameter to your SQL query file replaces the variables @prtg (Microsoft SQL, MySQL, PostgreSQL), :prtg (Oracle SQL), or ? (ADO SQL) in the SQL query, considering the general rules for SQL variables.
|
Input Parameter
|
This field is only visible if you enable Use input parameter above. Enter the parameter that you want to pass to the SQL query file. This parameter replaces the variables @prtg, :prtg, or ? in the SQL query, considering the general rules for SQL variables.
You can also use PRTG placeholders for custom sensors (command-line parameters) as input parameters, for example, %sensorid or %deviceid. For details, see section Custom Sensors.
Provide strings as they are and do not surround them with quotation marks. PRTG automatically and correctly inserts string parameters into the query.
|
Use Transaction
|
Define if you want to use transactions and if they affect the database content:
- Don't use transaction (default): Do not execute transactions.
- Use transaction and always rollback: The query does not change data in the database. In the SQL query file, separate the single steps of the transaction with semicolons.
- Use transaction and commit on success: The query changes data in the database. The changes only apply if all execution steps succeed without any errors. In the SQL query file, separate the single steps of the transaction with semicolons.
|
Data Processing
|
Shows how you process data from the database. Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Handle DBNull in Channel Values as
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. Define the sensor behavior if the query returns DBNull:
- Error: Show a Down status if the query returns DBNull.
- Number 0: Recognize the result DBNull as a valid value and interpret it as the number 0.
|
Select Channel Value by
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. Define how the desired cell in the database table is selected:
- Column number: Determine the channel value by using the value in row 0 of the column whose number you specify in Sensor Channel #x Column Number.
- Column name: Determine the channel value by using the value in row 0 of the column whose name you specify in Sensor Channel #x Column Name.
- Row number: Determine the channel value by using the value in column 0 of the row whose number you specify in Sensor Channel #x Row Number.
- Key value pair: Determine the channel value by searching in column 0 for the key you specify in Sensor Channel #x Key and by returning the value in column 1 of the same row where the key value was found.
Defining how the desired cell in the database table is selected is necessary to configure the cells that are used in the sensor channels.
The option you select here also defines the method of how to optionally determine a value for the sensor message. For details, see setting Use Data Table Value in Sensor Message.
See section Monitoring Databases for an example for channel value selection.
|
Sensor Channel #x
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. The setting shows if the sensor channel is disabled. Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Sensor Channel #x Name
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. Enter a unique name for the channel. Enter a string. PRTG dynamically generates channels with this name as identifier. Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Sensor Channel #x Column Number
|
This setting is only visible if you select the channel value by Column number. Provide the number of the column that is used to determine the channel value in row 0. Enter an integer value.
|
Sensor Channel #x Column Name
|
This setting is only visible if you select the channel value by Column number. Provide the name of the column that is used to determine the channel value in row 0. Enter a string.
|
Sensor Channel #x Row Number
|
This setting is only visible if you select the channel value by Row number. Provide the number of the row that is used to determine the channel value in column 0. Enter an integer value.
|
Sensor Channel #x Key
|
This setting is only visible if you select the channel value by Key value pair. Provide the key to search for in column 0 of the data table. The value in column 1 of the same row where the key value was found is used to determine the channel value. Enter a string.
|
Sensor Channel #x Mode
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. The setting shows how you want to display the determined value in the channel. Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Sensor Channel #x Unit
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. Define the unit of the channel value:
- BytesBandwidth
- BytesMemory
- BytesDisk
- Temperature
- Percent
- TimeResponse
- TimeSeconds
- TimeHours
- Count
- CPU
- BytesFile
- SpeedDisk
- SpeedNet
- Custom
- Value Lookup
Once you have created the sensor, you cannot change this value. It is shown for reference purposes only. If you need to change this value, add the sensor anew.
|
Sensor Channel #x Custom Unit
|
This setting is only visible if you select the sensor channel unit Custom. Define a unit for the channel value. Enter a string.
|
Sensor Channel #x Value Lookup
|
This setting is only visible if you select the sensor channel unit Value Lookup. Select a lookup file that you want to use with this channel.
|
Use Data Table Value in Sensor Message
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor. Define if the sensor message shows a value from the data table:
- Disable: Do not use a custom sensor message.
- Enable: Define a custom sensor message with a defined value of the data table. Define the value selection below.
The method of how to determine a value for the sensor message is defined in the setting Select Channel Value by above.
|
Sensor Message Column Number
|
This setting is only visible if you select the channel value by Column number and enable Use Data Table Value in Sensor Message above. Enter the number of a column. The sensor message shows the value in row 0 of this column. Enter an integer value.
Columns and rows start with index 0.
|
Sensor Message Column Name
|
This setting is only visible if you select the channel value by Column name and enable Use Data Table Value in Sensor Message above. Enter the name of a column. The sensor message shows the value in row 0 of this column. Enter a string.
Columns and rows start with index 0.
|
Sensor Message Row Number
|
This setting is only visible if you select the channel value by Row number and enable Use Data Table Value in Sensor Message above. Enter the number of a row. The sensor message shows the value in column 0 of this row. Enter an integer value.
Columns and rows start with index 0.
|
Sensor Message Key
|
This setting is only visible if you select the channel value by Key value pair and enable Use Data Table Value in Sensor Message above. Enter a key to search for in column 0 of the data table. The sensor message shows the value in column 1 of the row where the key was found. Enter a string.
Columns and rows start with index 0.
|
Sensor Message
|
This setting is only visible if you enable Use Data Table Value in Sensor Message. Define the sensor message. Enter a string. Use the placeholder {0} at the position where you want to display the value.
Example: The message is {0}
The number sign (#) is not supported in sensor messages. If a message contains a number sign, the message is clipped at this point.
|
If Sensor Message Changes
|
This setting is only visible if you select Process data table for the setting Data Processing when adding the sensor.
Define what the sensor does when the sensor value changes:
- Ignore changes (default): Take no action on change.
- Trigger 'change' notification: Send an internal message indicating that the sensor value has changed. In combination with a Change Trigger, you can use this mechanism to trigger a notification whenever the sensor value changes.
|
Sensor Result
|
Define what PRTG does with the sensor results:
- Discard sensor result: Do not store the sensor result.
- Write sensor result to disk (File name: Result of Sensor [ID].txt): Store the last result received from the sensor to the Logs (Sensors) subfolder of the PRTG data directory on the probe system that the sensor runs on (on the Master node if in a cluster). File names: Result of Sensor [ID].txt and Result of Sensor [ID].Data.txt. This is for debugging purposes. PRTG overwrites these files with each scanning interval.
For more information on how to find the folder used for storage, see section Data Storage.
This option is not available when the sensor runs on the Hosted Probe of a PRTG hosted by Paessler instance.
|