From 2c443984020459befd66245cf0fde07e2ee148a1 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Fri, 8 Jul 2022 09:33:10 +0200 Subject: [PATCH] move codeblock to check pipes --- icinga-cli.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/icinga-cli.sh b/icinga-cli.sh index 51ecb42..f8ccc9b 100755 --- a/icinga-cli.sh +++ b/icinga-cli.sh @@ -352,6 +352,13 @@ function processCheck(){ _elog "${_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 | rev | cut -f 1 -d '|' | rev` + _echo + _echo -------- check output: + _echo $( cat "$_outfile" ) + iPipes=$( sed 's#[^|]##g' "$_outfile" | grep "." | wc -L ) _echo "Pipe chars: $iPipes" if [[ $iPipes -gt 1 ]]; then @@ -359,12 +366,6 @@ function processCheck(){ exit 1 fi - typeset -i local iTsEnd=`date +%s` - # outPerfdata=`grep '|' $_outfile | cut -f 2 -d '|'` - outPerfdata=`grep '|' $_outfile | rev | cut -f 1 -d '|' | rev` - _echo - _echo -------- check output: - _echo $( cat "$_outfile" ) _echo # echo -------- extracted performance data: # echo $outPerfdata -- GitLab