X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=charts.d%2Fcpufreq.chart.sh;h=b21504a0e16b59c45a02d76fb2a5f3d8b6f4377b;hb=32e8eda4c4d6370e96233a69cab861b2ebb5cc9a;hp=008ffe1d7066e5fa6cc9567d86e3b700dc7871ce;hpb=77612636a4c605549f911e4a505c77bb707aaf39;p=netdata.git diff --git a/charts.d/cpufreq.chart.sh b/charts.d/cpufreq.chart.sh old mode 100755 new mode 100644 index 008ffe1d..b21504a0 --- a/charts.d/cpufreq.chart.sh +++ b/charts.d/cpufreq.chart.sh @@ -1,9 +1,15 @@ -#!/bin/sh +# no need for shebang - this file is loaded from charts.d.plugin + +# netdata +# real-time performance and health monitoring, done right! +# (C) 2016 Costa Tsaousis +# GPL v3+ +# # if this chart is called X.chart.sh, then all functions and global variables # must start with X_ -cpufreq_sys_dir="/sys/devices" +cpufreq_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices" cpufreq_sys_depth=10 cpufreq_source_update=1 @@ -51,15 +57,14 @@ cpufreq_create() { id="$( fixid "cpu$cpu" )" - echo >&2 "charts.d: cpufreq: on file='$file', dir='$dir', cpu='$cpu', id='$id'" + debug "file='$file', dir='$dir', cpu='$cpu', id='$id'" echo "DIMENSION $id '$id' absolute 1 1000" - echo >>$TMP_DIR/cpufreq.sh "printf \"SET $id = \"; cat $file " + echo >>$TMP_DIR/cpufreq.sh "echo \"SET $id = \"\$(< $file )" done echo >>$TMP_DIR/cpufreq.sh "echo END" [ $cpufreq_source_update -eq 1 ] && echo >>$TMP_DIR/cpufreq.sh "}" - # cat >&2 $TMP_DIR/cpufreq.sh # ok, load the function cpufreq_update() we created [ $cpufreq_source_update -eq 1 ] && . $TMP_DIR/cpufreq.sh