Article
Figure 1
Figure 2
Figure 3
Figure 4
Listing 2
Listing 3
Listing 1: The load Script
1: #
2: # load: Display system load, with suggestions as to how appropriate a
3: # time it is to run a CPU-intensive process.
4: #
5:
6: echo
7: echo " SYSTEM LOAD ANALYSIS"
8: echo
9:
10: uptime | awk '{
11: val = $(NF - 2)
12:
13: if (substr(val, length(val), length(val)) == ",")
14: val = substr(val, 1, length(val)-1)
15:
16: printf "The current system load is %s\n\n", val
17:
18: if (val < 1) {
19: print "This is a very light system load."
20: print "It is a good time to run a report."
21: }
22: else if (val < 1.5) {
23: print "This is a relatively light system load. It is OK to run"
24: print "a report now."
25: } else if (val < 2) {
26: print "This is a moderate system load. Long reports will slow"
27: print "the system down a bit, but go ahead if you must."
28: print "Better yet, for low-priority reports, wait until the"
29: print "system load drops below 1.00."
30: } else if (val < 3) {
31: print "This is a medium-to-heavy load.
|