What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

After updating to PRTG 20.1.55, my Python Script Advanced sensors are down

Votes:

0

After updating to PRTG 20.1.55 all my Python Script Advanced sensors are in the Down status. What is causing this issue?

custom-sensor important prtg python python-script-advanced-sensor

Created on Feb 20, 2020 2:11:11 PM by  Florian Weik (1,927) 2 2

Last change on Jan 5, 2023 8:15:45 AM by  Brandy Greger [Paessler Support]



4 Replies

Accepted Answer

Votes:

1

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 versionNew version
Importing pae libsfrom paepy.ChannelDefinition
import CustomSensorResult
from prtg.sensor.result import CustomSensorResult
from prtg.sensor.units import ValueUnit
Properties for channel definition changedresult.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:

Created on Feb 21, 2020 2:01:33 PM by  Florian Weik (1,927) 2 2

Last change on Jul 18, 2022 3:04:38 PM by  Florian Weik (1,927) 2 2



Votes:

0

Hi,

Thanks for the detail in this explanation, I think that will help me. Do you publish the prtg module you use at all? It would be really useful to be able to run the same scripts on my dev machine before trying to run the scripts on the PRTG server.

I can see there is a prtg module published to PyPi for pip installation: https://pypi.org/project/prtg/. However, this module does not support the functionality you outline above.

Cheers, Andy

Created on Oct 3, 2020 11:17:14 AM



Votes:

0

Hello,

the two PRTG modules are part of the Python integration in PRTG. In order to import other modules, please open "C:\Program Files (x86)\PRTG Network Monitor\python\Scripts" and run "fix-python-tools.bat".

If the project you linked relies on the old PRTG Python integration, it will however not work.

Created on Oct 5, 2020 4:07:01 PM by  Arne Seifert [Paessler Support]





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.