Difference between revisions of "Process Usage Scripts"

From James Dooley's Wiki
Jump to: navigation, search
(Created page with "==Overview== Scripts to check total usage of running processes on server. ==Total Memory Usage== <code>[bash,n] for i in $(ps auxw | awk '{print $11}' | grep -v "\[" | sort | un...")
 
Line 1: Line 1:
 +
[[Category:One Liners]]
 
==Overview==
 
==Overview==
 
Scripts to check total usage of running processes on server.
 
Scripts to check total usage of running processes on server.

Revision as of 17:40, 17 February 2012

Overview

Scripts to check total usage of running processes on server.

Total Memory Usage

[bash,n] for i in $(ps auxw | awk '{print $11}' | grep -v "\[" | sort | uniq | sort); do ps auxw | grep $i | awk '{total = total + $6}END{print total}' | xargs echo "$i " | awk '{print $2":"$1}'; done | sort -k 1 -nr

Total Processor Usage

[bash,n] for i in $(ps auxw | awk '{ print $11}' | grep -v "\[" | sort | uniq |sort); do ps auxw |grep $i|awk '{total=total+$3}END{print total}'|xargs echo "$i" | awk '{print $2":"$1}';done | sort -k 1 -nr