diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-10-20 22:04:28 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-10-20 22:04:28 +0300 |
commit | addb52bb18ba356fc1cb5888b1fe5b809137346d (patch) | |
tree | 61f3294473d70f9f96e2e302837ff844a70e3207 /charts.d/sensors.chart.sh | |
parent | c6d3138cc7ddb21bac33df2fc9f16c6e76ff1426 (diff) |
better log management for charts.d.plugin - fixes #1144
Diffstat (limited to 'charts.d/sensors.chart.sh')
-rwxr-xr-x | charts.d/sensors.chart.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/charts.d/sensors.chart.sh b/charts.d/sensors.chart.sh index 9652f896a0..f30177a4b1 100755 --- a/charts.d/sensors.chart.sh +++ b/charts.d/sensors.chart.sh @@ -43,7 +43,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 +64,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 +83,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 +121,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 +221,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 |