summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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))