home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / lang / perl4.035.V010.lzh / perl4.035 / eg / scan / scan_ps < prev    next >
Encoding:
Text File  |  1992-08-05  |  748 b   |  33 lines

  1. #!/usr/bin/perl -P
  2.  
  3. # $Header: scan_ps,v 4.0 91/03/20 01:13:29 lwall Locked $
  4.  
  5. # This looks for looping processes.
  6.  
  7. #if defined(mc300) || defined(mc500) || defined(mc700)
  8. open(Ps, '/bin/ps -el|') || die "scan_ps: can't run ps";
  9.  
  10. while (<Ps>) {
  11.     next if /rwhod/;
  12.     print if index(' T', substr($_,62,1)) < 0;
  13. }
  14. #else
  15. open(Ps, '/bin/ps auxww|') || die "scan_ps: can't run ps";
  16.  
  17. while (<Ps>) {
  18.     next if /dataserver/;
  19.     next if /nfsd/;
  20.     next if /update/;
  21.     next if /ypserv/;
  22.     next if /rwhod/;
  23.     next if /routed/;
  24.     next if /pagedaemon/;
  25. #ifdef vax
  26.     ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$start,$time) = split;
  27. #else
  28.     ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$time) = split;
  29. #endif
  30.     print if length($time) > 4;
  31. }
  32. #endif
  33.