]> arthur.barton.de Git - netdata.git/blobdiff - charts.d/load_average.chart.sh
better example chart for generic use
[netdata.git] / charts.d / load_average.chart.sh
index 8cc5af6ec6c98895e69a4ffe851d362b5d034f77..4d86a8f4c00f341b851ef4f6674f876a16cf0680 100755 (executable)
@@ -3,6 +3,12 @@
 load_average_update_every=5
 load_priority=100
 
+# this is an example charts.d collector
+# it is disabled by default.
+# there is no point to enable it, since netdata already
+# collects this information using its internal plugins.
+load_average_enabled=0
+
 load_average_check() {
        # this should return:
        #  - 0 to enable the chart
@@ -15,13 +21,14 @@ load_average_check() {
                load_average_update_every=5
        fi
 
+       [ ${load_average_enabled} -eq 0 ] && return 1
        return 0
 }
 
 load_average_create() {
        # create a chart with 3 dimensions
 cat <<EOF
-CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
+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
 DIMENSION load15 '15 mins' absolute 1 100