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 ScriptDescription
dice_roll.pyA script that shows you how to take a parameter from PRTG and output the result to PRTG.
dropbox_space_free.pyA script that uses a third-party package to monitor the free space on a Dropbox file share.
  • This script requires the dropbox package.
echo_int.pyA script that shows you how to echo an integer. Use this example as a starting point for writing your own script.
hybrid_parameters_ping.pyA script that can be used interactively via command line and as a sensor script.
  • This script requires the ping3 package. For more information, see the script file.

Linux

Example ScriptDescription
remote_ssh_linux_network.pyA script that fetches statistics of network interfaces from a Linux system via SSH.
  • This script requires the fabric package.
remote_ssh_linux_system_load.pyA script that shows you how to monitor a remote system via SSH.
  • This script requires the fabric package.

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 ScriptDescription
dice_roll.ps1A script that shows you how to take a parameter from PRTG and output the result to PRTG.
disk_space_free.ps1A script that shows the free disk space of a local drive, with warning/error limits.
echo_int.ps1A script that shows you how to echo an integer. Use this example as a starting point for writing your own scripts.
network_interface_stats.ps1A script that shows you how to use counter channels, custom units, and dynamically generated channels for each local network interface.
ping_host.ps1A script that you can use interactively via command line and as a sensor script.
remote_computer_load.ps1A script that shows you how to monitor a remote Windows system via PowerShell remoting.
  • This script requires PowerShell remoting (WinRM) to be enabled on the target host.
service_status.ps1A 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.