You can find a list of all available example scripts in the PRTG Manual: Additional Sensor Types (Custom Sensors). |
This article applies as of PRTG 24
Script v2 sensor example scripts
As of PRTG 23.x.82, users can add the Script v2 sensor and use Python script examples to customize their monitoring.
As of PRTG 26.3.124, users can also use PowerShell script examples.
Python example scripts
The script files are stored in the \Custom Sensors\scripts\examples\python subfolder of the PRTG program directory on the probe system on Windows systems, or in the /opt/paessler/share/doc/examples/scripts/python directory on the probe system on Linux systems.
To use the scripts, copy them to the \Custom Sensors\scripts subfolder of the PRTG program directory on the probe system on Windows systems, or to the /opt/paessler/share/scripts directory on the probe system on Linux systems. On Linux systems, you must also remove the .sample extension from the file name.
Windows
| Example Script | Description |
| dice_roll.py | A script that shows you how to take a parameter from PRTG and output the result to PRTG. |
| dropbox_space_free.py | A script that uses a third-party package to monitor the free space on a Dropbox file share.
|
| echo_int.py | A script that shows you how to echo an integer. Use this example as a starting point for writing your own script. |
| hybrid_parameters_ping.py | A script that can be used interactively via command line and as a sensor script.
|
Linux
| Example Script | Description |
| remote_ssh_linux_network.py | A script that fetches statistics of network interfaces from a Linux system via SSH.
|
| remote_ssh_linux_system_load.py | A script that shows you how to monitor a remote system via SSH.
|
For more information about the scripts and the requirements, see the readme.md in the example script folder and in the script files themselves.
PowerShell example scripts
The script files are stored in the \Custom Sensors\scripts\examples\powershell subfolder of the PRTG program directory on the probe system. These scripts are available on Windows only.
To use the scripts, copy them to the \Custom Sensors\scripts subfolder of the PRTG program directory on the probe system. Create a new Script v2 sensor and choose one or more PowerShell scripts from the list in the sensor settings.
Note: These scripts require PowerShell 7 (pwsh) or later. Windows PowerShell 5.1 is not supported.
| Example Script | Description |
| dice_roll.ps1 | A script that shows you how to take a parameter from PRTG and output the result to PRTG. |
| disk_space_free.ps1 | A script that shows the free disk space of a local drive, with warning/error limits. |
| echo_int.ps1 | A script that shows you how to echo an integer. Use this example as a starting point for writing your own scripts. |
| network_interface_stats.ps1 | A script that shows you how to use counter channels, custom units, and dynamically generated channels for each local network interface. |
| ping_host.ps1 | A script that you can use interactively via command line and as a sensor script. |
| remote_computer_load.ps1 | A script that shows you how to monitor a remote Windows system via PowerShell remoting.
|
| service_status.ps1 | A script that shows you how to use a lookup channel, based on the state of a Windows service. |
For more information about the scripts and the requirements, see the readme.md in the example script folder and in the script files themselves.