Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 1992 > 9203
Article Figure 1 Figure 2 Figure 3 Figure 4 Listing 1 Listing 3

Listing 2: The a Script

1: #
2: #   a:  Analyze number of system/user processes and system load.
3: #       Written by Leor Zolman, 3/91
4: #
5: #   usage:
6: #       a
7: #
8: # assumes:
9: #   1) "uptime" command (equivalent to "w -t") is available
10: #   2) printer processes are all run with user-id "lp"
11: #
12:
13: echo
14: uptime
15: echo
16: echo Analyzing...
17:
18: rootpros=`expr \`ps -u root | wc -l \` - 1`
19: lppros=`expr \`ps -u lp | wc -l \` - 1`
20:
21: otherpros=`expr $rootpros + $lppros`
22: totpros=`expr \`ps -e | wc -l \` - 3`
23:
24: userpros=`expr $totpros - $otherpros`
25: shpros=`ps -ef | awk '{
26:  if (($8 == "-sh" || $8 == "-ksh" || $8 == -csh) && $1 != root)
27:     print
28:  }' | wc -l`
29: nonshpros=`expr $userpros - $shpros`
30: nusers=`expr \`who | awk '{print $1}' | sort | uniq | wc -l\``
31: int=`expr $userpros / $nusers`
32: mod100=`expr \`expr $userpros '*' 100 /  $nusers\` % 100`
33: intnonsh=`expr $nonshpros / $nusers`
34: mod100nonsh=`expr \`expr $nonshpros '*' 100 /  $nusers\` % 100`
35: echo
36:
37: echo "User processes.............

				  



MarketPlace

Instant Answers to Your IT & Business Questions
Sign Up & Get Full Access To The Definitive Online Book Collection With SkillSoft's Books24x7�.

NEW! Numara FootPrints 9 - Service Desk Management
IT Service Management that Delivers. Real Value. Real Flexibility. Real Results. Free Demo.

Online Crash Analysis
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Wanna see your ad here?