.TH lps 1 "September 2010" "sac-tools" .SH NAME lps \- show process data .SH SYNOPSIS .B lps .B [ \-s ] .B [ \-c ] .B [ \-u ] .B [ \-U ] .B [ \-L proclimit] .B [ min-uid .B [ max-uid ] ] .br .SH DESCRIPTION .B lps shows process data in .I SPACE separated columns and is primarily designed to be used in scripts. .br With "min-uid" and "max-uid" a range of effective user ids of processes can be specified. .br The twelve columns of .B lps output are: .br .TP .B age The process age (default unit: minutes). It\'s the difference between uptime and starttime in seconds. Starttime in seconds is starttime of /proc/self/stat (value #21) divided by HZ (jiffies or ticks per second). HZ is calculated by dividing starttime(self) by uptime. Don\'t mix process age up with the actual "running time"! .TP .B pid The process ID. .TP .B user The user name of the effective user id. If the user name cannot be retrieved then the effective user id is printed. .TP .B RSS The resident set size in KB, taken from /proc/pid/stat. .TP .B VPID The virtual process ID, taken from /proc/pid/stat. On systems not supporting VPID "0" will be printed. .TP .B CTID/FNID The virtual private server ID (OpenVZ), taken from /proc/pid/stat. On systems not supporting CTID "0" will be printed. .TP .B procname The name of the process as shown in /proc/pid/stat. .TP .B sockusage If the process has at least one open socket then "socket" will be printed in this column. .TP .B root The (ch)root of the process in fs as shown in /proc/pid/root. .TP .B cwd The working dir of the process in fs as shown in /proc/pid/cwd. .TP .B exe The file executable of the process as shown in /proc/pid/exe. .TP .B cmdline The complete process command line as shown in /proc/pid/cmdline. .SH OPTIONS .TP .B \-s Show process age in seconds instead of minutes. .TP .B \-c Suppress normal output. Show total count of processes. .TP .B \-u Suppress normal output. Show up to 3 users with topmost process counts. .TP .B \-U Search every /proc/PID/environ for an environment variable HTTP_USER_AGENT. If found, show it after "cmdline" at the end of every output line and prefixed with "HTTP_USER_AGENT=". It's useful to quickly discover "crawler attacks" on webservers. .TP .B \-L proclimit Suppress normal output. Show top user if top user's procs count reaches proclimit. .SH "SEE ALSO" nagios-check-longuserprocesses(1) .PP http://downloads.tuxad.de/ .SH EXAMPLES Show process data with effective user id >= 1 (all processes except root processes) and sort output by process age: .RS $ lps 1 | sort -n .RE .br Step through process list: .RS $ lps -s 10000|while read AGE PID USER RSS VPID CTID PROCNAME MUCHMOREVARS;do if [ $AGE ... .RE .br .SH CAVEATS The maximum internal absolute pathname length is 16384 chars. .SH AUTHOR Frank Bergmann, http://www.tuxad.com