PRTG Manual: SNMP Custom String v2 Sensor

The SNMP Custom String v2 sensor monitors a string returned by a specific object identifier (OID) via the Simple Network Management Protocol (SNMP). The sensor interprets the SNMP value returned by the OID as a string, a MAC address, or an IPv4 address and shows the interpreted value in the sensor message.

SNMP Custom String v2 Sensor

SNMP Custom String v2 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: SNMP Custom String v2
  • French: SNMP Custom String v2
  • German: SNMP Benutzerdefinierte Zeichenfolge v2
  • Japanese: SNMP Custom String v2
  • Portuguese: SNMP Custom String v2
  • Russian: SNMP Custom String v2
  • Simplified Chinese: SNMP Custom String v2
  • Spanish: Cadena (personalizado) (SNMP) v2

Remarks

Consider the following remarks and requirements for this sensor:

Requirement

Description

Credentials

This sensor requires credentials for SNMP in settings that are higher in the object hierarchy.

Multi-platform probe

You can add this sensor to a multi-platform probe.

IPv6

This sensor supports IPv6.

Performance impact

This sensor has a very low performance impact.

Lookups

This sensor uses lookups to determine the status values of one or more channels.

Scanning interval

This sensor has a fixed minimum scanning interval for performance reasons. You cannot use a shorter scanning interval. Consequently, shorter scanning intervals in the Monitoring settings are not available for this sensor.

  • The minimum scanning interval of this sensor is 1 minute.
  • The recommended scanning interval of this sensor is 1 minute.

Knowledge Base

Knowledge Base: How do I find out which OID I need for an SNMP Custom sensor?

Basic Sensor Settings

Basic Sensor Settings

Basic Sensor Settings

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

  • snmp
  • snmpcustomsensor

i_square_cyanFor more information about basic sensor settings, see section Sensor Settings.

Specific Sensor Settings

Specific Sensor Settings

Specific Sensor Settings

Setting

Description

OID

Enter the OID of the object that you want to monitor. You can enter the numeric OID or the symbolic name. If you use the symbolic name, enter its full path. For example, iso.org.dod.internet.mgmt.mib-2.host.hrSystem.hrSystemUptime.hrSystemUptime.

Search String

Enter the string that you want to search for.

i_round_blueThis setting is case-sensitive.

Search String Contains

Select how PRTG processes the search string:

  • Simple string (default): The search string contains no wildcards or regular expressions. PRTG treats it as plain text and does not use pattern matching.
  • Wildcards: The search string contains one or more wildcards. You can use an asterisk (*) to match any number of characters or a question mark (?) to match exactly one character.
  • Regular expression: The search string contains a regular expression (regex). This sensor supports ECMAScript regex.

Interpret Result As

Select how the sensor interprets the SNMP value returned by the OID:

  • String (default): Handle the result as a string. No interpretation takes place.
  • MAC address: Interpret the SNMP value returned by the OID as a MAC address. If you select this option, make sure to enter the MAC address with lowercase characters and use hyphens as separators in the Search String settings. For example, ab-cd-12-34-56-78.
  • IPv4 address: Interpret the SNMP value returned by the OID as an IPv4 address.

Sensor Behavior

Select how the sensor reacts based on the result of the string search:

  • Do not change sensor status (default): The result of the string search does not affect the sensor status.
  • Show down status if string is not found: Show the Down status if the string is not found.
  • Show down status if string is found: Show the Down status if the string is found.
  • Show warning status if string is not found: Show the Warning status if the string is not found.
  • Show warning status if string is found: Show the Warning status if the string is found.

Numeric Extraction

Define if you want to extract a float value from the received string:

  • Disable (default): Do not extract a float value.
  • Enable: Use a regular expression to identify a numeric value in the string and to convert it to a float value to use it, for example, with channel limits.
    i_square_cyanFor more information about channel limits, see section Channel Settings.

i_round_bluePRTG first interprets the SNMP value returned by the OID according to the Interpret Result As setting. The sensor displays the extracted number in the Extracted Number channel.

Regular Expression for Numeric Extraction

This setting is only visible if you select Enable above.

Enter a regular expression to define the float value that you want to extract from the string returned by the SNMP object at the specified OID. You can use capturing groups.

i_round_blueIf there are multiple matches, the sensor uses the first match. If there are no matches or the matched value cannot be converted to a float value, the sensor shows the Down status.

i_round_redMake sure that the expression only returns numbers, including the decimal and thousands separators.

Index of Capturing Group

This setting is only visible if you select Enable above.

If your regex uses capturing groups, specify which one captures the number. Enter a 0-based index or leave the setting empty. If you leave this setting empty, the sensor uses group 0 if the expression matches the whole string exactly and group 1 if the expression matches a string partially.

i_square_cyanFor more information about how to use a regular expression  index with this sensor, see the Number Extraction with Regular Expression example below.

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

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 this sensor shows different channels:

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

Debug Options

Debug Options

Debug Options

Setting

Description

Result Handling

Define what PRTG does with the sensor result:

  • Discard result (default): Do not store the sensor result.
  • Store result: Store the sensor result and the last response in the \Logs\sensors subfolder of the PRTG data directory on the probe system. The file name is Result of Sensor [ID].log. This setting is for debugging purposes. PRTG overwrites this file with each scanning interval.

i_podThis option is not available when the sensor runs on the hosted probe of a PRTG Hosted Monitor instance.

i_round_blueIn a cluster, PRTG stores the result in the PRTG data directory of the master node.

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.

Number Extraction with Regular Expression

i_speechIf you want to extract a number in the response string via a regex, note that the index for captures in this sensor is based on 1 (not on 0). Furthermore, capturing groups are not automatically created. The example below illustrates this issue.

Consider the following string as returned by a request for CPU usage:

5 Sec (3.49%), 1 Min (3.555%), 5 Min (3.90%)

Assuming you would like to filter for the number 3.555, this is the percentage in the second parentheses. Enter the following regex in the Regular Expression field:

(\d+\.\d+).*?(\d+\.\d+).*?(\d+\.\d+)

As Index of Capturing Group, enter 3. This extracts the desired number 3.555.

The index must be 3 in this case because the capturing groups here are the following:

  • Group 1 contains 3.49%), 1 Min (3.555), 5 Min (3.90
  • Group 2 contains 3.49
  • Group 3 contains 3.555
  • Group 4 contains 3.90

Keep this note about index and capturing groups in mind when using number extraction.

i_round_redIt is not possible to match an empty string with the PRTG regex sensor search.

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

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.

Extracted Number

The float value extracted from the string

i_round_blueThe sensor only creates this channel if you enable Numeric Extraction in the Specific Sensor Settings.

Response Time

The response time

String Found

If the search string is found in the SNMP value returned by the OID

i_round_blueThe channel status and the displayed value type depend on the Sensor Behavior setting. If you select Do not change sensor status (default), the sensor displays a value of 1 in channel if the search string is found. Otherwise, the displayed value is determined via lookup.

i_round_blueThis channel is the primary channel by default.

More

i_square_blueKNOWLEDGE BASE

What security features does PRTG include?