1 # no need for shebang - this file is loaded from charts.d.plugin
3 load_average_update_every=5
6 # this is an example charts.d collector
7 # it is disabled by default.
8 # there is no point to enable it, since netdata already
9 # collects this information using its internal plugins.
10 load_average_enabled=0
12 load_average_check() {
14 # - 0 to enable the chart
15 # - 1 to disable the chart
17 if [ ${load_average_update_every} -lt 5 ]
19 # there is no meaning for shorter than 5 seconds
20 # the kernel changes this value every 5 seconds
21 load_average_update_every=5
24 [ ${load_average_enabled} -eq 0 ] && return 1
28 load_average_create() {
29 # create a chart with 3 dimensions
31 CHART system.load '' "System Load Average" "load" load system.load line $((load_priority + 1)) $load_average_update_every
32 DIMENSION load1 '1 min' absolute 1 100
33 DIMENSION load5 '5 mins' absolute 1 100
34 DIMENSION load15 '15 mins' absolute 1 100
40 load_average_update() {
41 # do all the work to collect / calculate the values
43 # remember: KEEP IT SIMPLE AND SHORT
45 # here we parse the system average load
46 # it is decimal (with 2 decimal digits), so we remove the dot and
47 # at the definition we have divisor = 100, to have the graph show the right value
48 loadavg="`cat /proc/loadavg | sed -e "s/\.//g"`"
49 load1=`echo $loadavg | cut -d ' ' -f 1`
50 load5=`echo $loadavg | cut -d ' ' -f 2`
51 load15=`echo $loadavg | cut -d ' ' -f 3`
53 # write the result of the work.