Skip to content

Commit

Permalink
Pass correct info to run funct. (#6126)
Browse files Browse the repository at this point in the history
* Pass correct info to run funct.

Changed to allow the correct parameters to be sent to the run function.
Also changed to set apcupsd_status variable correctly.

* Fixing as per comments
  • Loading branch information
Steve8291 authored and cakrit committed May 28, 2019
1 parent e11a4e4 commit 423057b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
Expand Up @@ -47,8 +47,8 @@ apcupsd_check() {
error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}."
failed=$((failed + 1))
else
apcupsd_status=$(apcupsd_get ${apcupsd_sources[${host}]} | awk '/^STATUS.*/{ print $3 }')
if [ "$apcupsd_status" != "ONLINE" ] && [ "$apcupsd_status" != "ONBATT" ]; then
apcupsd_status="$(apcupsd_get ${apcupsd_sources[${host}]} | awk '/^STATUS.*/{ print $3 }')"
if [ "${apcupsd_status}" != "ONLINE" ] && [ "${apcupsd_status}" != "ONBATT" ]; then
error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online."
failed=$((failed + 1))
else
Expand Down
2 changes: 1 addition & 1 deletion collectors/charts.d.plugin/charts.d.plugin.in
Expand Up @@ -304,7 +304,7 @@ run() {
printf " --- END TRACE ---\n"
} >&2
fi
rm "${TMP_DIR}/run.${pid}"
rm -f "${TMP_DIR}/run.${pid}"

return ${ret}
}
Expand Down

0 comments on commit 423057b

Please sign in to comment.