This article applies as of PRTG 20.1.55
Python library update and Python Script Advanced sensors
PRTG 20.1.55 includes a new Python distribution because of the end-of-life announcement for Python 3.4. The new Python distribution includes a new prtg library and new cryptography libraries.
New /prtg/ library
We replaced the existing paepy library with the new prtg library. The new property names that were used to create a result set now adhere to the custom advanced sensor nomenclature of PRTG. The new libraries also support the full custom advanced set.
To make sure that your Python Script Advanced sensors continue to work properly, please review the updated Python Script Advanced sensor example and adjust your Python scripts accordingly.
You can find the example sensor_example.py in the \python subfolder of the PRTG program directory under:
%programfiles(x86)%\PRTG Network Monitor\Custom Sensors\python
or
%programfiles%\PRTG Network Monitor\Custom Sensors\python
New cryptography libraries
We also replaced the cryptography libraries. PRTG Python now ships with cryptography and PyCryptodome. This is because the previously used libraries are no longer maintained. In addition, the integrated Python now also ships with pip and setuptools preinstalled. This change eases the integration of other packages.
Most important changes
| Old version | New version |
Importing pae libs | from paepy.ChannelDefinition import CustomSensorResult | from prtg.sensor.result import CustomSensorResult from prtg.sensor.units import ValueUnit |
Properties for channel definition changed | result.add_channel(channel_name= "Response Time", unit= "TimeResponse", value="4711") | csr.add_channel(name="Response Time", value=4711, unit=ValueUnit.TIMERESPONSE) |
For more information, see the full change log for Python 3.7:
Add comment