What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Custom Sensor based on wmiprocesssensor

Votes:

0

Hello,

I want to make my own custom sensor which provides the same information as the predefined wmiprocesssensor (CPU Usage, Handles, Instances etc.) BUT ALSO is able to monitor the process memory usage >4GB which is mentioned here:

https://kb.paessler.com/en/topic/60640-wmi-process-64-bit-os-4-gb-ram

But for this I need to know how the wmiprocesssensor does the CPU Usage calculation. Is there a source file for this sensor where I can check how it is calculated?

cpu custom-sensor sensor wmi

Created on Jan 24, 2018 10:32:56 AM



1 Reply

Votes:

0

You can use the following simple query to get a hosts's CPU usage via Powershell:

$var = Get-WmiObject -Query "SELECT Name, PercentProcessorTime FROM Win32_PerfFormattedData_PerfOS_Processor"

Foreach ($a in $var) {
    Write-Output "Core #$($a.Name) = $($a.PercentProcessorTime) %"
}

The values are returned in %, no additional calculation is necessary. You will just need to make the formating PRTG friendly and include the Invoke-Command, remoting, credentials and everything else that needs to be done for this to "work" within PRTG. This is the bare minimum example/POC.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jan 24, 2018 12:20:59 PM by  Luciano Lingnau [Paessler]

Last change on Jan 24, 2018 12:21:08 PM by  Luciano Lingnau [Paessler]




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.