diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
commit | 8a7b72f7cd1ccd547a03eb4243294e741d661d3f (patch) | |
tree | 7bc7be4a8e9e298daa1349348400aa2a653866f2 /collectors/charts.d.plugin/load_average/load_average.chart.sh | |
parent | New upstream version 1.11.1+dfsg (diff) | |
download | netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.tar.xz netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.zip |
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin/load_average/load_average.chart.sh')
-rw-r--r-- | collectors/charts.d.plugin/load_average/load_average.chart.sh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/collectors/charts.d.plugin/load_average/load_average.chart.sh b/collectors/charts.d.plugin/load_average/load_average.chart.sh index b30cb850f..841e3d9f6 100644 --- a/collectors/charts.d.plugin/load_average/load_average.chart.sh +++ b/collectors/charts.d.plugin/load_average/load_average.chart.sh @@ -21,8 +21,7 @@ load_average_check() { # - 0 to enable the chart # - 1 to disable the chart - if [ ${load_average_update_every} -lt 5 ] - then + if [ ${load_average_update_every} -lt 5 ]; then # there is no meaning for shorter than 5 seconds # the kernel changes this value every 5 seconds load_average_update_every=5 @@ -34,7 +33,7 @@ load_average_check() { load_average_create() { # create a chart with 3 dimensions -cat <<EOF + cat <<EOF CHART system.load '' "System Load Average" "load" load system.load line $((load_priority + 1)) $load_average_update_every DIMENSION load1 '1 min' absolute 1 100 DIMENSION load5 '5 mins' absolute 1 100 @@ -52,10 +51,10 @@ load_average_update() { # here we parse the system average load # it is decimal (with 2 decimal digits), so we remove the dot and # at the definition we have divisor = 100, to have the graph show the right value - loadavg="`cat /proc/loadavg | sed -e "s/\.//g"`" - load1=`echo $loadavg | cut -d ' ' -f 1` - load5=`echo $loadavg | cut -d ' ' -f 2` - load15=`echo $loadavg | cut -d ' ' -f 3` + loadavg="$(cat /proc/loadavg | sed -e "s/\.//g")" + load1=$(echo $loadavg | cut -d ' ' -f 1) + load5=$(echo $loadavg | cut -d ' ' -f 2) + load15=$(echo $loadavg | cut -d ' ' -f 3) # write the result of the work. cat <<VALUESEOF @@ -68,4 +67,3 @@ VALUESEOF return 0 } - |