xref: /titanic_52/usr/src/cmd/acct/ptelus.awk (revision ac88567a7a5bb7f01cf22cf366bc9d6203e24d7a)
1#ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.8	*/
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23BEGIN	{
24	MAXCPU = 20.		# report if cpu usage is greater than this
25	MAXKCORE = 500.		# report is Kcore usage is greater than this
26	MAXCONNECT = 120.	# report if connect time is greater than this
27}
28
29NR == 1	 {
30	MAXCPU = MAXCPU + 0
31	MAXKCORE = MAXKCORE + 0
32	MAXCONNECT = MAXCONNECT + 0
33	printf "Logins with exceptional Prime/Non-prime Time Usage\n"
34	printf ( "CPU > %d or KCORE > %d or CONNECT > %d\n\n\n", MAXCPU, MAXKCORE, MAXCONNECT)
35	printf "\tLogin\t\tCPU (mins)\tKCORE-mins\tCONNECT-mins\tdisk"
36	printf "\t# of\t# of\t# Disk\tfee\n"
37	printf "UID\tName\t\tPrime\tNprime\tPrime\tNprime\t"
38	printf "Prime\tNprime\tBlocks\tProcs\tSess\tSamples\n\n"
39}
40
41$3 > MAXCPU || $4 > MAXCPU || $5 > MAXKCORE || $6 > MAXKCORE || $7 > MAXCONNECT || $8 > MAXCONNECT {
42	printf("%d\t%-8.8s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
43}
44
45