3 load_average_update_every=5
8 # - 0 to enable the chart
9 # - 1 to disable the chart
11 if [ ${load_average_update_every} -lt 5 ]
13 # there is no meaning for shorter than 5 seconds
14 # the kernel changes this value every 5 seconds
15 load_average_update_every=5
21 load_average_create() {
22 # create a chart with 3 dimensions
24 CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
25 DIMENSION load1 '1 min' absolute 1 100
26 DIMENSION load5 '5 mins' absolute 1 100
27 DIMENSION load15 '15 mins' absolute 1 100
33 load_average_update() {
34 # do all the work to collect / calculate the values
36 # remember: KEEP IT SIMPLE AND SHORT
38 # here we parse the system average load
39 # it is decimal (with 2 decimal digits), so we remove the dot and
40 # at the definition we have divisor = 100, to have the graph show the right value
41 loadavg="`cat /proc/loadavg | sed -e "s/\.//g"`"
42 load1=`echo $loadavg | cut -d ' ' -f 1`
43 load5=`echo $loadavg | cut -d ' ' -f 2`
44 load15=`echo $loadavg | cut -d ' ' -f 3`
46 # write the result of the work.