<%NUMBERING1%>.<%NUMBERING2%>.<%NUMBERING3%> PRTG Manual: Additional Sensor Types (Custom Sensors)

Users can create and use their own, self-written custom sensors in PRTG Network Monitor to go far beyond PRTG's standard sensor set. You can create your own sensors using Windows Management Instrumentation Query Language (WQL), visual basic scripting, PowerShell, batch scripting, SQL queries, by compiling an EXE or DLL file (using any Windows software development tool), and by running Python scripts.

icon-prtg-on-demand You cannot use custom sensors on cloud probes in PRTG in the cloud (except SSH sensors). If you want to use custom sensors, please add them to a remote probe device.

Basics

For a general introduction, please see the sections about EXE/Script sensors and the API documentation which contains details about the necessary return format for these sensors. WMI Custom sensors allow executing WQL requests.

Additionally, some types of SQL sensors execute script files with SQL queries:

Custom Sensors Included in PRTG

After installing PRTG Network Monitor, you will already find a selection of custom EXE/Script, Python, and WMI WQL script sensors in the PRTG program directory, as well as scripts with SQL queries for specific database sensors and REST configuration files for the REST Custom sensor. Many of these are sample projects that you can edit and improve for your needs.

Custom Sensors Included in PRTG—Folder: \Custom Sensors\EXE

  • Demo Batchfile - Returns 200.bat
  • Demo Batchfile - Set sensorstate to error.bat
  • Demo Batchfile - Set sensorstate to warning.bat
  • Demo Cmd - Returns 200.cmd
  • Demo Dll - Returns a random integer.dll
  • Demo EXE - Returns a random integer.exe
  • Demo EXE - Returns number of files in folder (parameter).exe
  • Demo EXE - Returns user of process.exe
  • Demo Powershell Script - Available MB via WMI.ps1
  • Demo Powershell Script - InterruptsPerSec via WMI.ps1
  • Demo Powershell Script - Powershell Version.ps1
  • Demo Powershell Script - Returns a fixed integer value.ps1
  • Demo Powershell Script - Returns a random integer value.ps1
  • Demo Powershell Script - Returns Random Integer and Warnings.ps1
  • Demo VBScript - InterruptsPerSec via WMI.vbs
  • Demo VBScript - Multiplies two integers(2 parameters).vbs
  • Demo VBScript - Returns a fixed float value.vbs
  • Demo VBScript - Returns a fixed integer value.vbs
  • Demo VBScript - Returns a random value.vbs
  • Demo VBScript - Returns number of svchost processes.vbs
  • Demo VBScript - Returns user of process.vbs
  • Demo VBScript - Returns warning depending on number of svchost processes.vbs
  • Demo VBScript - Timezone via WMI.vbs
  • Demo VBScript - UTCTime via WMI.vbs
  • Load_Test_CPU_1_Mio_Primes.exe
  • Load_Test_CPU_10_Mio_Primes.exe
  • Load_Test_Disk_Write_Read_1000_files.exe
  • Load_Test_Disk_Write_Read_10000_files.exe
  • Load_Test_Memory_Allocate_And_Free_400MB.exe

To create a new sensor based on one of these files, create a new EXE/Script Sensor and choose the respective file from the EXE/Script list in the sensor settings.

Custom Sensors Included in PRTG—Folder: \Custom Sensors\EXEXML

  • Demo Batchfile - Returns static values in four channels.bat

To create a new sensor based on one of these files, create a new EXE/Script Advanced Sensor and choose the respective file from the EXE/Script list in the sensor settings.

Custom Sensors Included in PRTG—Folder: \Custom Sensors\python

  • sensor_example.py

This Python example script just returns fixed values in two channels to demonstrate the usage. To create a new sensor based on this file, create a new Python Script Advanced Sensor and choose the file from the Python Script list in the sensor settings.

Custom Sensors Included in PRTG—Folder: \Custom Sensors\rest

  • kemp.loadbalancer.json: maps values returned by the RESTful API of a KEMP load balancer to sensor channels, for example, CPU usage, memory usage, traffic
  • prtg-sensor-stats.json: maps values returned by the API of your PRTG installation to sensor channels that show the count of each sensor status on the local probe
  • windows.docker.container.stats.json: maps values returned by the Docker Engine API to sensor channels, for example, CPU usage, memory usage, traffic, I/O
  • wunderground.json: maps values returned by the Weather Underground API to sensor channels, for example, temperature, dew point, pressure, wind speed, wind direction

To create a new sensor based on one of these files, create a new REST Custom Sensor on the device that provides the REST API and choose the file from the REST Configuration File list in the sensor settings.

SQL Query Files Included in PRTG—Folder: \Custom Sensors\sql\<dbms>

  • Demo Serveruptime.sql

You can find this demo SQL query script in each subfolder for each supported database management system (dbms): \mssql, \mysql, \oracle, \postgresql

To create a new sensor that uses one of the scripts in the dbms folders, create the according sensor type (see above for supported sensors) and choose the respective file from the SQL Query File list in the sensor settings.

Custom Sensors Included in PRTG—Folder: \Custom Sensors\WMI WQL scripts

  • Demo WQL Script - Get Win32LogicalDiscFreeMB.wql
  • Demo WQL Script - Get Win32OsBuildnumber.wql
  • Demo WQL Script - Get Win32PercentProcessorIdleTime.wql
  • Demo WQL Script - Get Win32PercentProcessorTime.wql

To create a new sensor based on one of these files, create a new WMI Custom Sensor and choose the respective file from the WQL File list in the sensor settings.

Downloading Pre-Built Custom Sensors

Good resources to find custom sensors that PRTG users and we from Paessler share are the PRTG Script World and our Knowledge Base. In the Knowledge Base, search for the tag custom-script-exe to find a lot of custom sensors: https://kb.paessler.com/en/tags/custom-script-exe/

More

You can find useful scripts for sensors in the PRTG Script World:

For the other sensor types that work out-of-the-box, please see

Knowledge Base: Guide for PowerShell Based Custom Sensors

Knowledge Base: Custom sensors

Knowledge Base: How can I share my self-written PRTG script/program with other PRTG users?

Knowledge Base: How can I test if parameters are correctly transmitted to my script when using an EXE/Script sensor?

Knowledge Base: Why do I have to store SQL sensor queries and custom scripts in files on the probe computer?

Sensor Settings Overview

For information about sensor settings, please see the following sections:

Ajax Web Interface—Device and Sensor Setup—Topics

Other Ajax Web Interface Sections

Related Topics

Keywords: Google,Google Code