I get the following error when executing a python advanced sensor

06/03/2020 10:00:56 Script Output (UTF8 Encoding): Traceback (most recent call last):[CR][LF]  File "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\python\HourLongRunningThreads.py", line 7, in <module>[CR][LF]    from requests import Session[CR][LF]ImportError: No module named 'requests'[CR][LF]

Is there a way to just print the desired json isntead of using the paepy module to create it? I just need a simple channel that returns 1 value

prtg version 19.2.50.2842+ python 3.7


Article Comments

I was able to download the requests module but my script needs a module that's not in python 3.4 so I created a batch script that reads the output of the python script instead.


Mar, 2020 - Permalink

Hello there.

As of PRTG version 22.1.74 it is possible to install/add modules to PRTG's python. If my script needs the requests module for example, I can do so by heading to C:\Program Files (x86)\PRTG Network Monitor\python\ (PRTG's install path) and issuing:

python.exe -m pip install requests

Afterwards requests can be used in scripts. This has to be done on a per-probe basis.

Best regards,
Luciano Lingnau, Paessler Team


Feb, 2022 - Permalink

For the benefit of anyone who finds this thread in future, be aware that you need to be logged into Windows as THE "Administrator" account to install the required modules. Being logged in as AN administrator is insufficient.

Oh, and you also need to be on a release later than 22.2.77.2204:

PRTG Version 22.2.77.2204 broke compatibility with pip.exe install (to install Python packages). With this PRTG release we have removed support for this command to prevent unexpected errors. As of now the only supported way of installing a Python package to use Python Script Advanced sensor is python.exe -m pip install. Please also see our Knowledge Base article for more information about Python installation: https://helpdesk.paessler.com/en/support/solutions/articles/90686.


- Greig.


Sep, 2022 - Permalink