i would like to read the firmware of our firewalls with regex. unfortunately i always get the error -9.9999999. the display of the firmware in the message is so v6.2.4,build1112,200511 (GA).

I would like to display the first 3 numbers in my sensor so 6.2.4, this I tried with this regex entry (\d+\.\d+.\d+) and the group 1.


Article Comments

Hello,

Thank you for your message.

I invite you to give it a try with the following regex: \d{1,2}\.\d{1,2}\.\d{1,3}

Kind regards.


Jan, 2021 - Permalink

Hi

tested the regex now, with the same result -9.99999999. i filled the fields as below.

Extract Number Using Regular Expression Extract a numeric value using a regular expression

Regular Expression \d{1,2}\.\d{1,2}\.\d{1,3}

Index of Capturing Group blank

Decimal Separator .

Thousands Separator .


Jan, 2021 - Permalink

Thank you for the information, I understand what you would like to achieve now. However, in PRTG you can only monitor integer or float values and therefore, you can't get the version number (6.2.4) as a channel value.

With the SNMP Custom String sensor, you can still see the version displayed in the sensor message as indicated in the manual: https://www.paessler.com/manuals/prtg/snmp_custom_string_sensor.

If you have questions, let us know.

Regards.


Jan, 2021 - Permalink

Hi

but when i test the query with this regex i get the first two digits. why does it not work with the 3rd one?

Value: v6.2.4,build1112,200511 (GA)

(\d+\.\d+)

Sensor: 6.2


Jan, 2021 - Permalink

It indeed works with 2 digits as it is considered as float value. However, the value 6.2.4 is neither an integer nor a float, and therefore can't be monitored (as channel value).

Regards.


Jan, 2021 - Permalink