home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / lib / acct / ptecms.awk < prev    next >
Encoding:
AWK Script  |  1990-12-08  |  718 b   |  32 lines

  1. #!/usr/bin/awk -f
  2.  
  3.  
  4. #ident    "@(#)/usr/lib/acct/ptecms.awk.sl 1.1 4.0 12/08/90 56800 AT&T-USL"
  5.  
  6. BEGIN {
  7.     MAXCPU = 20.0        # report if cpu usage greater than this
  8.     MAXKCORE = 1000.0    # report if KCORE usage is greater than this
  9. }
  10.  
  11. NF == 4    { print "\t\t\t\t" $1 " Time Exception Command Usage Summary" }
  12.  
  13. NF == 3    { print "\t\t\t\tCommand Exception Usage Summary" }
  14.  
  15. NR == 1    {
  16.     MAXCPU = MAXCPU + 0.0
  17.     MAXKCORE = MAXKCORE + 0.0
  18.     print "\t\t\t\tTotal CPU > " MAXCPU " or Total KCORE > " MAXKCORE
  19. }
  20.  
  21. NF <= 4 && length != 0    { next }
  22.  
  23. $1 == "COMMAND" || $1 == "NAME"    { print; next }
  24.  
  25. NF == 10 && ( $4 > MAXCPU || $3 > MAXKCORE ) && $1 != "TOTALS"
  26.  
  27. NF == 13 && ( $5 + $6 > MAXCPU || $4 > MAXKCORE ) && $1 != "TOTALS"
  28.  
  29. length == 0
  30.  
  31.  
  32.