From d2228f2a8bb87cf6f2426abfe318dd8512bc80c2 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Fri, 8 Jul 2022 10:09:31 +0200
Subject: [PATCH] show failed command on abort

---
 icinga-cli.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/icinga-cli.sh b/icinga-cli.sh
index 87c2019..5fcb92a 100755
--- a/icinga-cli.sh
+++ b/icinga-cli.sh
@@ -363,6 +363,7 @@ function processCheck(){
       _echo "Pipe chars: $iPipes"
       if [[ $iPipes -gt 1 ]]; then
         _elog "ABORT - pipes were found in plugin output"
+        _elgo "command was: $myFullscript $myparams"
         exit 1
       fi
 
@@ -372,6 +373,7 @@ function processCheck(){
       # echo
       if ! test -n "$outPerfdata" && echo "$outPerfdata" | grep "=[0-9\.]*;[0-9\.]*;[0-9\.]*;[0-9\.]*;" >/dev/null; then
         _elog "ABORT - this does not look like performance data: $outPerfdata"
+        _elgo "command was: $myFullscript $myparams"
         exit 1
       fi
       _log "${_logPrefix} check command finished with returncode $rc"
-- 
GitLab