View Full Version : How to get top cpu/memory processes from windows
easy_john
24-07-2009, 07:11
I looking for sollution to get string with top cpu/memory process from windows servers.
Looks like: "idle.exe 90% netlogon.exe 10% ..."
I get this string from linux with this little script:
echo `ps axk -pcpu o pcpu,comm|head -n6|tail -n5|tr -d [:cntrl:]`
Is it possible to get it from windows?
P.S. Very necessary for you to have person, who will moderate a forum, delete a spam, and the main thing - operatively to help users with their questions.
thiagomz
09-08-2010, 17:07
I need the same here ! Anyone ?
easy_john
09-08-2010, 17:13
still nothing. may be some powep script ?
easy_john
09-08-2010, 17:15
i mean power shell.
I know this thread is a bit old, but I'm also looking for a way to have Zabbix generate an email containing a list of the top processes on a windows machine. I am new to Zabbix, so I have started working this from the windows side. I've come up with this command to generate a decent list:
tasklist /s [hostname] /v /FI "CPUTIME gt 00:25:00"
This generates a list of processes that have >25 minutes cpu time. Only thing I need now is to output it, have Zabbix pick it up, and email it.
easy_john
03-05-2011, 13:07
nice.
tasklist /v /FI "CPUTIME gt 00:25:00"
and
tasklist /FI "MEMUSAGE ge 10000"
list top cpu/mem usage process.
now we need to cut only 2-3 column and can import to zabbix.
What if we had the tasklist command output to a text file and had zabbix pick that up?
tasklist /s [hostname] /v /FI "CPUTIME gt 00:25:00" > c:\top5.txt
easy_john
03-05-2011, 14:28
no, you can directly take some output to zabbix.
but you need decrease amount of columns a bit.
in zabbix_agentd.conf :
UserParameter=custom.top.cpu,"bla-bla"
no, you can directly take some output to zabbix.
but you need decrease amount of columns a bit.
in zabbix_agentd.conf :
UserParameter=custom.top.cpu,"bla-bla"
Ok cool so the "bla-bla" would be the windows command?
tasklist /s [hostname] /v /FI "CPUTIME gt 00:25:00"
If so, that's nice and simple!
easy_john
04-05-2011, 16:03
Ok cool so the "bla-bla" would be the windows command?
tasklist /s [hostname] /v /FI "CPUTIME gt 00:25:00"
If so, that's nice and simple!
No "/s [hostname]", because you already on some host.
And this script produce to big output, it will be unreadable in one string, like zabbix store it to base.
You need reduce output.
I store linux top cpu/mem process and it looks like this:
[2011.May.04 18:12:05] 1.2 mysqld 2.9 apache2 2.7 apache2 2.7 apache2 2.8 apache2
[2011.May.04 18:11:35] 1.2 mysqld 2.9 apache2 2.7 apache2 2.7 apache2 2.8 apache2
[2011.May.04 18:11:09] 1.2 mysqld 2.9 apache2 2.7 apache2 2.7 apache2 2.8 apache2
[2011.May.04 18:10:37] 1.2 mysqld 2.9 apache2 2.7 apache2 2.7 apache2 2.8 apache2
[2011.May.04 18:10:06] 1.2 mysqld 2.9 apache2 2.7 apache2 2.7 apache2 2.8 apache2