Re: Linux script to get most expensive processes

2015-08-05 Thread Laura Creighton
If you are running this script with Python 2 write: if sys.platform.startswith('linux'): to handle the case where you get linux or linux2 (and a few other weird things some embedded systems give you ...) Right now I think every linux system returns linux for Python 3, so it is less of an issu

Re: Linux script to get most expensive processes

2015-08-05 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > Under Linux I like to get the most expensive processes. The two most > useful commands are: > ps -eo pid,user,pcpu,args --sort=-pcpu > and: > ps -eo pid,user,pcpu,args --sort=-vsize > > In my case I am only interested in the seven most expensive processes. > For t

Re: Linux script to get most expensive processes

2015-08-04 Thread Cecil Westerhof
On Wednesday 5 Aug 2015 00:00 CEST, MRAB wrote: >> I amended the code to work with linux and linux2: >> >> accepted_params = { 'pcpu', 'rss', 'size', 'time', 'vsize', } >> accepted_platforms = { 'linux', 'linux2', } current_

Re: Linux script to get most expensive processes

2015-08-04 Thread Cecil Westerhof
On Wednesday 5 Aug 2015 00:12 CEST, Emile van Sebille wrote: > On 8/4/2015 2:30 PM, Cecil Westerhof wrote: >> On Tuesday 4 Aug 2015 22:52 CEST, Emile van Sebille wrote: > >>> My platform shows as linux2 and it worked fine for me when >>> checking for that. >> >> I heard that that was possible al

Re: Linux script to get most expensive processes

2015-08-04 Thread Emile van Sebille
On 8/4/2015 2:30 PM, Cecil Westerhof wrote: On Tuesday 4 Aug 2015 22:52 CEST, Emile van Sebille wrote: My platform shows as linux2 and it worked fine for me when checking for that. I heard that that was possible also, but none of my systems gives this. I should change it. You could also u

Re: Linux script to get most expensive processes

2015-08-04 Thread MRAB
On 2015-08-04 22:30, Cecil Westerhof wrote: On Tuesday 4 Aug 2015 22:52 CEST, Emile van Sebille wrote: On 8/4/2015 1:19 PM, Cecil Westerhof wrote: Under Linux I like to get the most expensive processes. The two most useful commands are: ps -eo pid,user,pcpu,args --sort=-pcpu and: ps -eo pid,u

Re: Linux script to get most expensive processes

2015-08-04 Thread Cecil Westerhof
On Tuesday 4 Aug 2015 22:52 CEST, Emile van Sebille wrote: > On 8/4/2015 1:19 PM, Cecil Westerhof wrote: >> Under Linux I like to get the most expensive processes. The two >> most useful commands are: ps -eo pid,user,pcpu,args --sort=-pcpu >> and: ps -eo pid,user,pcpu,args --sort=-vsize >> >> In

Re: Linux script to get most expensive processes

2015-08-04 Thread Emile van Sebille
On 8/4/2015 1:19 PM, Cecil Westerhof wrote: Under Linux I like to get the most expensive processes. The two most useful commands are: ps -eo pid,user,pcpu,args --sort=-pcpu and: ps -eo pid,user,pcpu,args --sort=-vsize In my case I am only interested in the seven most expensive processe

Linux script to get most expensive processes

2015-08-04 Thread Cecil Westerhof
Under Linux I like to get the most expensive processes. The two most useful commands are: ps -eo pid,user,pcpu,args --sort=-pcpu and: ps -eo pid,user,pcpu,args --sort=-vsize In my case I am only interested in the seven most expensive processes. For this I wrote the following script. =