Skip to content
Snippets Groups Projects
Commit 5db78f94 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

check writable response file; output with _log instead of echo

parent 48141cfb
Branches
No related tags found
No related merge requests found
......@@ -314,19 +314,19 @@ function processCheck(){
eval $myFullscript $myparams > $_outfile
rc=$?
if [ ! -w $_outfile ]; then
echo "ERROR: file $_outfile is not writable. Maybe the setup is inclomplete or someone created a file as root... just guessing."
ls -ld ${dir_data} $_outfile
exit 1
_log "${_logPrefix} ERROR: output file $_outfile is not writable."
_log "${_logPrefix} $( ls -ld ${dir_data} $_outfile )"
exit 1
fi
typeset -i local iTsEnd=`date +%s`
outPerfdata=`grep '|' $_outfile | cut -f 2 -d '|'`
# outPerfdata=`grep '|' $_outfile | cut -f 2 -d '|'`
echo
echo -------- check output:
cat $_outfile
echo
echo -------- extracted performance data:
echo $outPerfdata
echo
# echo -------- extracted performance data:
# echo $outPerfdata
# echo
_log "${_logPrefix} check command finished with returncode $rc"
_rc=$_rc+$rc
......@@ -359,6 +359,11 @@ function processCheck(){
echo POST actions/process-check-result?service=${myHost}!${slot} "$data"
_APIcall POST actions/process-check-result?service=${myHost}!${slot} "$data"
http.responseExport "$_response"
if [ ! -w "$_response" ]; then
_log "${_logPrefix} ERROR: responsefile $_response is not writable."
_log "${_logPrefix} $( ls -ld ${dir_data} $_response )"
exit 1
fi
# --- check if data were sent successfully
# fgrep "HTTP/1.1 200" ${_response} >/dev/null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment