Hi
can some one help with monitoring all process CPU usage and view hystoric data then?
thnx
Article Comments
I need monitor ALL processes not one specific sensor. I need to find in specific time witch process has top CPU usage.
Oct, 2018 - Permalink
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
Oct, 2018 - Permalink
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.
Oct, 2018 - Permalink
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
Oct, 2018 - Permalink
@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
Nov, 2019 - Permalink
What's not working in regards to the script if I may ask? Perhaps I'm able to help here :)
Nov, 2019 - Permalink
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
Oct, 2018 - Permalink