diff options
author | Lennart Weller <lhw@ring0.de> | 2017-01-24 15:21:16 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2017-01-24 15:21:16 +0000 |
commit | ef0c127e7f95d2db2715b9e99fe758eebc7dabd3 (patch) | |
tree | ea5d62342aba06f376f3be63aab898503b56f3ec /charts.d/sensors.chart.sh | |
parent | update watch file and files-exclude (diff) | |
parent | New upstream version 1.5.0+dfsg (diff) | |
download | netdata-ef0c127e7f95d2db2715b9e99fe758eebc7dabd3.tar.xz netdata-ef0c127e7f95d2db2715b9e99fe758eebc7dabd3.zip |
Merge tag 'upstream/1.5.0+dfsg'
Upstream version 1.5.0+dfsg
Diffstat (limited to 'charts.d/sensors.chart.sh')
-rwxr-xr-x | charts.d/sensors.chart.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/charts.d/sensors.chart.sh b/charts.d/sensors.chart.sh index 9652f896a..125c925da 100755 --- a/charts.d/sensors.chart.sh +++ b/charts.d/sensors.chart.sh @@ -1,5 +1,11 @@ # 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 <costa@tsaousis.gr> +# GPL v3+ +# + # sensors docs # https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface @@ -43,7 +49,7 @@ sensors_check() { # - 0 to enable the chart # - 1 to disable the chart - [ -z "$( sensors_find_all_files $sensors_sys_dir )" ] && echo >&2 "$PROGRAM_NAME: sensors: no sensors found in '$sensors_sys_dir'." && return 1 + [ -z "$( sensors_find_all_files $sensors_sys_dir )" ] && error "no sensors found in '$sensors_sys_dir'." && return 1 return 0 } @@ -64,7 +70,7 @@ sensors_check_files() { [ $v -ne 0 ] && echo "$f" && continue excluded= - echo >&2 "$PROGRAM_NAME: sensors: $f gives zero values" + error "$f gives zero values" done } @@ -83,7 +89,7 @@ sensors_check_temp_type() { v=$(( v + 1 - 1 )) [ $v -ne 0 ] && echo "$f" && continue - echo >&2 "$PROGRAM_NAME: sensors: $f is disabled" + error "$f is disabled" done } @@ -121,7 +127,7 @@ sensors_create() { id="$( fixid "$device.$subsystem.$dir" )" - echo >&2 "charts.d: sensors: on path='$path', dir='$dir', device='$device', subsystem='$subsystem', id='$id', name='$name'" + debug "path='$path', dir='$dir', device='$device', subsystem='$subsystem', id='$id', name='$name'" for mode in temperature voltage fans power current energy humidity do @@ -221,7 +227,6 @@ sensors_create() { done [ $sensors_source_update -eq 1 ] && echo >>$TMP_DIR/sensors.sh "}" - # cat >&2 $TMP_DIR/sensors.sh # ok, load the function sensors_update() we created [ $sensors_source_update -eq 1 ] && . $TMP_DIR/sensors.sh |