This article applies to PRTG Network Monitor 18 or later
Workaround for ''x' is not a valid floating point value'
You might receive the error message 'x' is not a valid floating point value when you use SNMP Custom, SNMP Custom Advanced, or SNMP Library sensors to monitor an OID that returns a value with a comma "," like 27,5545 as a float value.
Check the Value Returned by the OID
- Download and install SNMP Tester.
- Open the SNMP Tester and enter the following information.
- The Device IP/Port of the device.
- The SNMP Version as configured on the device.
- The Community as configured on the device.
- Select Custom OID and enter the OID you want to monitor. In this example, we use 1.3.6.1.4.1.6574.4.3.2.1.0 that corresponds to the UPS Battery Voltage value of a UPS device.
- Click Start to execute the request.
Click to enlarge.
The value 29,14885454 is correct and includes a comma but it is read as a string value and not a float value.
- In SNMP Tester, set Read As to Float.
- Click Start to execute the new request.
Click to enlarge.
The value 2914885454 is incorrect because it does not contain a decimal separator. The float value returned by the SNMP request must contain a dot '.' as decimal separator, otherwise PRTG cannot interpret the value.
Solution: Create an SNMP Custom String Sensor
The SNMP Custom String sensor allows you to extract a floating point value from a string result using a regular expression.
- Add an SNMP Custom String sensor to the device.
- Under OID Value, enter the OID. In our example it is 1.3.6.1.4.1.6574.4.3.2.1.0.
- In section Extended Processing, select Extract a numeric value using a regular expression.
- Under Regular Expression, enter ([0-9]+),([0-9]+) to convert the float value into an integer value.
- Under Index of Capturing Group, enter 2.
- Under Decimal Separator, enter a comma ','.
- Under Thousands Separator, enter a comma ','.
- Save your settings.
The sensor now shows the correct value.
Click to enlarge.
See Also
Add comment