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

Monitoring all process CPU usage

Votes:

0

Hi

can some one help with monitoring all process CPU usage and view hystoric data then?

thnx

cpu-load process prtg

Created on Oct 18, 2018 8:18:44 AM



9 Replies

Votes:

0

Hi there,

You can use the Windows Process Sensor to monitor processes of your choice. This sensor has got a channel for the total and average CPU usage.


Kind regards,
Felix Saure, Tech Support Team

Created on Oct 18, 2018 12:23:14 PM by  Felix Saure [Paessler Support]



Votes:

0

I need monitor ALL processes not one specific sensor. I need to find in specific time witch process has top CPU usage.

Created on Oct 22, 2018 11:34:27 AM



Votes:

0

Licencie, we're talking about Windows, correct? Or Linux? Do you need to find out which process is eating up CPU on long or short term?


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Oct 22, 2018 8:58:25 PM by  Stephan Linke [Paessler Support]



Votes:

0

Stephan we talking about windows. We need to find on long term in specific time which process use how many CPU. So we need monitoring all processes in long term (1-5 days) and then when user say now i have bad performance of PC find which proces in this time was on TOP.

Created on Oct 24, 2018 6:15:35 AM



Votes:

0

Something like this should do the trick:

param(
    $computerName = "localhost",
    $ignoreList   = @("_Total", "svchost*")
)

$channelTemplateCPULoad = @"
<result>
 <channel>[{0}] CPU Load</channel>
 <value>{1}</value>
 <unit>CPU</unit>
 <float>1</float>
 <DecimalMode>2</DecimalMode>
</result>
"@


$channelTemplateMemoryUsage = @"
<result>
 <channel>[{0}] Memory Usage</channel>
 <value>{1}</value>
 <Unit>BytesDisk</Unit>
 <VolumeSize>MegaByte</VolumeSize>
 <Float>1</Float>
</result>
"@

$properties=@(
    @{Name="Process Name"; Expression = {$_.name}},
    @{Name="CPU (%)"; Expression = {$_.PercentProcessorTime}},    
    @{Name="Memory (MB)"; Expression = {[Math]::Round(($_.workingSetPrivate / 1mb),2)}}
)
$Processes = (Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process -ComputerName $computerName | Select-Object $properties )

Write-Host "<prtg>";
Foreach($Process in $Processes){
        if( $Process.'Process Name' -notmatch $ignoreList){
        Write-Host ([string]::Format($channelTemplateCPULoad, $Process.'Process Name', $Process.'CPU (%)'))
        Write-Host ([string]::Format($channelTemplateMemoryUsage, $Process.'Process Name', $Process.'Memory (MB)'))
        }
}
Write-Host "</prtg>";

However, filtering via $ignoreList doesn't work properly yet, you'll need to work on that (otherwise, you'll have 300 or more svchost processes). The script is provided as is and should give you a starting point. We can't help in getting it up and running as desired in your environment. Please also check our Guide for PowerShell based Custom Sensors for further installation details.


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Oct 24, 2018 8:26:49 AM by  Stephan Linke [Paessler Support]



Votes:

0

@licencie Have you been successful setting up this kind of sensor? I am in the same situation and I'd be happy if you could let me know this. Many thanks

Created on Nov 28, 2019 2:43:17 PM



Votes:

0

What's not working in regards to the script if I may ask? Perhaps I'm able to help here :)

Created on Nov 29, 2019 8:18:17 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi there

Any ideas how to achive the same goal on Ubuntu Servers?

Created on Jun 11, 2020 12:50:27 PM



Votes:

0

Unfortunately, there's no real solution for that - sorry!

Created on Jun 12, 2020 6:41:10 AM by  Stephan Linke [Paessler Support]




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.