Skip to content
Snippets Groups Projects

fix quoting of perfdata in json

Merged Hahn Axel (hahn) requested to merge update-confighandler into master
1 file
+ 9
8
Compare changes
  • Side-by-side
  • Inline
+ 9
8
@@ -22,11 +22,12 @@
# 2023-02-17 v0.15 ah check inc_getconfig.sh exists and hostname -f has a value
# 2023-11-01 v0.16 ah generate json with "jo"
# 2023-11-02 v0.17 ah fix line breaks of sent output, shell check fixes
# 2023-11-02 v0.18 ah fix quoting of perfdata in json
# ======================================================================
_product="ICINGA PASSIVE CLIENT"
_version="0.17"
_version="0.18"
_license="GNU GPL 3.0"
_copyright='(c) Institute for Medical Education * University of Bern'
@@ -351,12 +352,12 @@ function processCheck(){
#
# --- extract performance data:
#
if ! test -n "$outPerfdata" && echo "$outPerfdata" | grep "=[0-9\.]*;[0-9\.]*;[0-9\.]*;[0-9\.]*;" >/dev/null; then
_elog "WARNING - this does not look like performance data: $outPerfdata"
_elog "command was: $myFullscript $myparams"
_log "${_logPrefix} this does not look like performance data: $outPerfdata"
outPerfdata=""
fi
# if ! test -n "$outPerfdata" && echo "$outPerfdata" | grep "=[0-9\.]*;[0-9\.]*;[0-9\.]*;[0-9\.]*;" >/dev/null; then
# _elog "WARNING - this does not look like performance data: $outPerfdata"
# _elog "command was: $myFullscript $myparams"
# _log "${_logPrefix} this does not look like performance data: $outPerfdata"
# outPerfdata=""
# fi
_log "${_logPrefix} check command finished with returncode $rc"
_rc=$_rc+$rc
@@ -373,7 +374,7 @@ function processCheck(){
ttl=$checkInterval \
execution_start=$iTsStart \
execution_end=$iTsEnd \
performance_data="\"${outPerfdata}\"" \
performance_data="${outPerfdata}" \
plugin_output="""${_output}"""
)"
Loading