New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Can i graph text values?

Votes:

0

Your Vote:

Up

Down

I would like to graph a binary SNMP value - it returns either "backoff" or "normal".

Using the SNMP Custom String Sensor, i see that the string value is displayed:

  • in the "message" column when i view the all sensors on the device
  • in the "message" column of the Log tab of the specific sensor Neither of these is graph-able

It's really important for me to be able to see on a graph when this value goes from Normal to Backoff and back again...

I guess i could use the Lookup feature to convert Backoff to "1" and Normal to "0" but then i get a graph with random numerical values,......

Any suggestions?

graphs lookup snmp string string-lookup

Created on Feb 7, 2017 1:22:03 PM by  trunq (10) 1

Last change on Feb 8, 2017 7:18:19 AM by  Luciano Lingnau [Paessler Support]



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello Trung,
thank you for your reply/elaboration and no worries. :)

Now, working with strings in PRTG can be somewhat tricky, let me cover/elaborate on the possibilities.

Regular String Monitoring

  • SNMP Custom String Sensor The SNMP Custom String Sensor allows you to poll any String, the channels will only display the Response Time, because only numerical values (1,2, 3, -5, 4.56, 0, ...) can be assigned to channels, this is one of PRTG's essential building blocks.

This sensor will only generate alerts by default if the string/oid becomes unreachable or unavailable. Otherwise, the sensor allows you to check the result against an expected string, or get notifications via Change Triggers if the value changes. Please note that the string matching will put the sensor into error state but won't modify or create additional channels, at this point Response Time is still the only channel.

Regular String Monitoring with Regex

  • SNMP Custom String Sensor While still employing the SNMP Custom String Sensor, you can modify the sensor's settings to use regular expressions to extract values from within these strings. For instance, CPU load from a Linux System can be obtained via SNMP and will look like the following:
5 Sec (3.49%), 1 Min (3.555%), 5 Min (3.90%)

This is obviously not a numerical value, but contains a couple of values. In this case the following regular expression can be used to extract any of the 3 relevant values:

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

The Index of Capturing Group will control which of the matches goes into the newly created "Extracted Value" channel from the sensor. You can read more about it here:

String via Lookup

  • SNMP Custom String Lookup Sensor The SNMP Custom String Lookup Sensor will be very handy if the OID that you're monitoring provides "Well known" responses/strings, like for example "active" or "inactive" (for a cluster/node status). The lookup has to be created using a text editor (it's an XML-like file), and it will tell the sensor:
  • Which string(s) to expect
  • Which sensor status will correspond to which string (active = ok, inactive = warning)
  • The desired value. In other words, this sensor turns the string into something that can easily be parsed and used in PRTG, will generate alerts and display the received string as well. The Value channel will display the received string mapped to a state. There's a real word example here:
  • Monitor and "Lookup" a SNMP String value
The issue with state averages

The desired value is sometimes underrated but is useful when it comes to the representation of averages. Keep in mind that PRTG is designed to work with numerical values(response time, traffic, disk use, etc). In this case we're talking about a "state". Still referring to the example above (active/inactive), assume the following scenario:

The sensor is polled every 60 seconds. The Live Data tab of the sensor displays the following:

Date TimeValue
08.02.2017 08:02:221(Active)
08.02.2017 08:01:221(Active)
08.02.2017 08:00:221(Active)
08.02.2017 07:59:222(Inactive)
08.02.2017 07:58:222(Inactive)

On the 2, 30 and 365 days tabs, PRTG displays average. If this was an ordinary number, that would be very easy. The average (from 07:58:22 to 08:02:22) is 1,4. However, we're talking about a State and not a Value. What's the Average between 3x Active and 2x Inactive? :)
Since there's no real answer, PRTG will use the desired value from the lookup to figure this. In this particular case, if the desired value was Active, PRTG would tell you that during that period, the value was the desired value 60% of the time.
Summing it up: Make sure that your desired value is correctly set and PRTG should provide a meaningful value from it.

Custom Approach

As PRTG is highly customizable, it shouldn't be too hard to put together a script/exe file that:

  1. Is run by PRTG on every sensor scan (aka Every Interval)
  2. Reads the parameters forwarded by the sensor (%host, %snmpcommunity)
  3. Performs the query using NET-SNMP's binaries (snmpwalk.exe or snmpget.exe) or other binary/dll of choice
  4. Parses the result according to your wishes (you can use a case statement to match strings to values)
  5. Formats the output in a single or multi-channels PRTG-API-compliant format (XML/JSON)
  6. PRTG reads and displays the values provided by the script.

Here are a couple of examples of Powershell/NET-SNMP based custom sensors:

Regular String Monitoring

Summing it all up: No, PRTG can't graph strings, but it offers a ton of other approaches and one of them will usually fit your requirements.


Best Regards,
Luciano Lingnau [Paessler Support]

Created on Feb 8, 2017 7:17:57 AM by  Luciano Lingnau [Paessler Support]

Last change on Dec 5, 2018 8:50:11 AM by  Luciano Lingnau [Paessler Support]



5 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,
thank you for your KB-Post.

  • What OID are you polling?
  • Are you able to share a screenshot from the settings and overview tab of your sensor? Please note that it's not possible to host images on the KB, you'll have to host them elsewhere and share the link here.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Feb 7, 2017 1:41:03 PM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Luciano

Many thanks for the quick reply. I should have been more specific - it's not a problem particularly with this sensor... It's that with many sensors in PRTG i'd like to be able to graph text-based values.
e.g. i could make a table so that:

  • 1 = dinosaur
  • 2 = rabbit

and then on my graph i would be able to see when the graph changes state from "dinosaur" to "rabbit" At the moment this doesnt seem to be possible.

Cheers,

Trunq

Created on Feb 7, 2017 1:48:30 PM by  trunq (10) 1

Last change on Feb 7, 2017 2:44:21 PM by  Luciano Lingnau [Paessler Support]



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello Trung,
thank you for your reply/elaboration and no worries. :)

Now, working with strings in PRTG can be somewhat tricky, let me cover/elaborate on the possibilities.

Regular String Monitoring

  • SNMP Custom String Sensor The SNMP Custom String Sensor allows you to poll any String, the channels will only display the Response Time, because only numerical values (1,2, 3, -5, 4.56, 0, ...) can be assigned to channels, this is one of PRTG's essential building blocks.

This sensor will only generate alerts by default if the string/oid becomes unreachable or unavailable. Otherwise, the sensor allows you to check the result against an expected string, or get notifications via Change Triggers if the value changes. Please note that the string matching will put the sensor into error state but won't modify or create additional channels, at this point Response Time is still the only channel.

Regular String Monitoring with Regex

  • SNMP Custom String Sensor While still employing the SNMP Custom String Sensor, you can modify the sensor's settings to use regular expressions to extract values from within these strings. For instance, CPU load from a Linux System can be obtained via SNMP and will look like the following:
5 Sec (3.49%), 1 Min (3.555%), 5 Min (3.90%)

This is obviously not a numerical value, but contains a couple of values. In this case the following regular expression can be used to extract any of the 3 relevant values:

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

The Index of Capturing Group will control which of the matches goes into the newly created "Extracted Value" channel from the sensor. You can read more about it here:

String via Lookup

  • SNMP Custom String Lookup Sensor The SNMP Custom String Lookup Sensor will be very handy if the OID that you're monitoring provides "Well known" responses/strings, like for example "active" or "inactive" (for a cluster/node status). The lookup has to be created using a text editor (it's an XML-like file), and it will tell the sensor:
  • Which string(s) to expect
  • Which sensor status will correspond to which string (active = ok, inactive = warning)
  • The desired value. In other words, this sensor turns the string into something that can easily be parsed and used in PRTG, will generate alerts and display the received string as well. The Value channel will display the received string mapped to a state. There's a real word example here:
  • Monitor and "Lookup" a SNMP String value
The issue with state averages

The desired value is sometimes underrated but is useful when it comes to the representation of averages. Keep in mind that PRTG is designed to work with numerical values(response time, traffic, disk use, etc). In this case we're talking about a "state". Still referring to the example above (active/inactive), assume the following scenario:

The sensor is polled every 60 seconds. The Live Data tab of the sensor displays the following:

Date TimeValue
08.02.2017 08:02:221(Active)
08.02.2017 08:01:221(Active)
08.02.2017 08:00:221(Active)
08.02.2017 07:59:222(Inactive)
08.02.2017 07:58:222(Inactive)

On the 2, 30 and 365 days tabs, PRTG displays average. If this was an ordinary number, that would be very easy. The average (from 07:58:22 to 08:02:22) is 1,4. However, we're talking about a State and not a Value. What's the Average between 3x Active and 2x Inactive? :)
Since there's no real answer, PRTG will use the desired value from the lookup to figure this. In this particular case, if the desired value was Active, PRTG would tell you that during that period, the value was the desired value 60% of the time.
Summing it up: Make sure that your desired value is correctly set and PRTG should provide a meaningful value from it.

Custom Approach

As PRTG is highly customizable, it shouldn't be too hard to put together a script/exe file that:

  1. Is run by PRTG on every sensor scan (aka Every Interval)
  2. Reads the parameters forwarded by the sensor (%host, %snmpcommunity)
  3. Performs the query using NET-SNMP's binaries (snmpwalk.exe or snmpget.exe) or other binary/dll of choice
  4. Parses the result according to your wishes (you can use a case statement to match strings to values)
  5. Formats the output in a single or multi-channels PRTG-API-compliant format (XML/JSON)
  6. PRTG reads and displays the values provided by the script.

Here are a couple of examples of Powershell/NET-SNMP based custom sensors:

Regular String Monitoring

Summing it all up: No, PRTG can't graph strings, but it offers a ton of other approaches and one of them will usually fit your requirements.


Best Regards,
Luciano Lingnau [Paessler Support]

Created on Feb 8, 2017 7:17:57 AM by  Luciano Lingnau [Paessler Support]

Last change on Dec 5, 2018 8:50:11 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Luciano

This is probably the best answer i've ever received for any question ever. you even answered questions about PRTG that have been lurking in the back of my head but hadn't even verbalised yet! haha

It's exactly what i needed.

Thanks!

Trunq

Created on Feb 8, 2017 1:02:41 PM by  trunq (10) 1



Votes:

0

Your Vote:

Up

Down

Awesome! This was also the best feedback I got in a while, so cheers!

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Feb 8, 2017 1:57:40 PM by  Luciano Lingnau [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.