perl 3.0: (no announcement message available)
[p5sagit/p5-mst-13.2.git] / eg / scan / scan_ps
1 #!/usr/bin/perl -P
2
3 # $Header: scan_ps,v 3.0 89/10/18 15:15:47 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