Hi all, I have a string snmp sensor and I used a REGEX in order to "Extract a numeric value using a regular expression". the value of the SNMP field may be: a string with a number (to be extracted), or empty It works perfect, but when the string is empty (standard behaviour), the sensor goes down. I'd like to transform the "empty" string to a zero value, in order to keep the sensor up. how can I do? (I have last release) many thanks! Gianluca
Extract a numeric value using a regular expression
Modified on 2025-06-10 22:51:45 +0200
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.
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.
Hello, we appreciate your contact.
Unfortunately the Regular Expression numerical extraction within PRTG isn't able to match an empty string. We suggest that you create a custom Sensor instead to be able to handle this sort of logic (if null then value = 0).
There's plentiful of examples for custom-scripts in the KB, this being an great example.
Sep, 2015 - Permalink