diff options
Diffstat (limited to 'eg/scan/scan_ps')
-rw-r--r-- | eg/scan/scan_ps | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/eg/scan/scan_ps b/eg/scan/scan_ps new file mode 100644 index 0000000000..bb33b87ae8 --- /dev/null +++ b/eg/scan/scan_ps @@ -0,0 +1,32 @@ +#!/usr/bin/perl -P + +# $Header: scan_ps,v 2.0 88/06/05 00:17:51 root Exp $ + +# This looks for looping processes. + +#if defined(mc300) || defined(mc500) || defined(mc700) +open(Ps, '/bin/ps -el|') || die "scan_ps: can't run ps"; + +while (<Ps>) { + next if /rwhod/; + print if index(' T', substr($_,62,1)) < 0; +} +#else +open(Ps, '/bin/ps auxww|') || die "scan_ps: can't run ps"; + +while (<Ps>) { + next if /dataserver/; + next if /nfsd/; + next if /update/; + next if /ypserv/; + next if /rwhod/; + next if /routed/; + next if /pagedaemon/; +#ifdef vax + ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$start,$time) = split; +#else + ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$time) = split; +#endif + print if length($time) > 4; +} +#endif |