New Question
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Download >>


What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more


Top Tags

View all Tags

How do I properly configure a WMI custom sensor?



Your Vote:



I need to monitor WMI counters that are not covered by the built-in WMI sensors set of PRTG. So I have written a few custom WQL scripts to be executed by PRTG. Are there any rules I should follow to setup custom WMI sensors?

custom-sensor help prtg wmi wmi-custom-sensor wql

Created on Feb 2, 2010 1:06:52 PM by  Dirk Paessler [Founder Paessler AG] (10,922) 3 4

Last change on Aug 28, 2017 9:36:45 AM by  Gerald Schoch [Paessler Support]

1 Reply

Accepted Answer



Your Vote:



This article applies to PRTG Network Monitor 19 or later

How to Add Your Own WQL Queries Using WMI Custom Sensors

If you want to use WMI to monitor counters that are not included in the standard set of WMI sensors in PRTG, you can add your own WMI WQL queries using the WMI Custom sensor or the WMI Custom String sensor.

Relevant Settings for Custom WMI Sensors

  • Namespace: Enter the namespace your WMI classes are located in, beginning with root, for example, root\CIMV2.
  • WQL File: When creating the sensor, you can select from the WQL script files located on the probe computer. After creation this field is read-only.
  • Placeholders: Customize your WQL scripts with up to three placeholders that are replaced with the values you enter in the sensor settings (see below).

Basic Requirements

Create a .WQL file and store it in the \Custom Sensors\WMI WQL scripts subfolder of the PRTG program directory on the respective probe computer, usually C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\WMI WQL scripts.

Enter a WQL query with one field returning a numerical value for the WMI Custom sensor. If your query returns a string value, use the WMI Custom String sensor. Multiple fields and multiple result rows are not supported.


SELECT Buildnumber FROM Win32_OperatingSystem

You can customize this query using a placeholder system, so you can re-use the script for more sensors, entering different values in the sensor’s settings.

For example, myProcess.wql contains this query:

SELECT <#PH1> FROM Win32_Process WHERE Description='<#PH2>'

Now you can add one sensor that monitors the thread count of the PRTG probe by specifying ThreadCount and PRTG Probe.exe in the <#PH1> and <#PH2> setting fields.

Or you could monitor the working set size of Outlook via <#PH1> = WorkingSetSize and <#PH2> = OUTLOOK.exe

If you want the number of entries in the result set to be returned alternatively to a direct value from a field, you can use the SELECT COUNT(*) statement.

Example: SELECT COUNT(*) FROM Win32_Process WHERE Name='explorer.exe'

Please be aware that using an unrestricted query might result in a timeout error.


Created on Feb 2, 2010 1:08:24 PM by  Dirk Paessler [Founder Paessler AG] (10,922) 3 4

Last change on May 20, 2019 10:02:56 AM by  Brandy Greger [Paessler Support]

Please log in or register to enter your reply.

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.