diff options
Diffstat (limited to '')
-rw-r--r-- | collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh (renamed from charts.d/apcupsd.chart.sh) | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/charts.d/apcupsd.chart.sh b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh index 9878fd36c..e26ef566a 100644 --- a/charts.d/apcupsd.chart.sh +++ b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh @@ -1,9 +1,10 @@ +# shellcheck shell=bash # no need for shebang - this file is loaded from charts.d.plugin +# SPDX-License-Identifier: GPL-3.0-or-later # netdata # real-time performance and health monitoring, done right! # (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ # apcupsd_ip= @@ -43,11 +44,12 @@ apcupsd_check() { for host in "${!apcupsd_sources[@]}" do run apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null + # shellcheck disable=2181 if [ $? -ne 0 ] then error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}." failed=$((failed + 1)) - elif [ $(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }') != "ONLINE" ] + elif [ "$(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }')" != "ONLINE" ] then error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online." failed=$((failed + 1)) @@ -183,6 +185,7 @@ END { print \"SET time = \" time; print \"END\" }" + # shellcheck disable=SC2181 if [ $? -ne 0 ] then failed=$((failed + 1)) |