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

Merge branch '5127-detect-5xx-server-error' into 'master'

icingacli - remove http statuscode

See merge request !7
parents 373a22a6 52cf4466
No related branches found
No related tags found
1 merge request!7icingacli - remove http statuscode
...@@ -401,7 +401,7 @@ function processCheck(){ ...@@ -401,7 +401,7 @@ function processCheck(){
# --- check if data were sent successfully # --- check if data were sent successfully
# fgrep "HTTP/1.1 200" ${_response} >/dev/null # fgrep "HTTP/1.1 200" ${_response} >/dev/null
# _testHttpOk ${_response} >/dev/null # _testHttpOk ${_response} >/dev/null
http.isOk 2>/dev/null http.isOk >/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
_log "${_logPrefix} OK, response was sent to Icinga" _log "${_logPrefix} OK, response was sent to Icinga"
else else
...@@ -410,6 +410,7 @@ function processCheck(){ ...@@ -410,6 +410,7 @@ function processCheck(){
_echo _echo
_echo For Debugging: _echo For Debugging:
_echo "$( $ch --show --json )" _echo "$( $ch --show --json )"
_log "$( $ch --show --json )"
fi fi
$ch --flush 2>/dev/null $ch --flush 2>/dev/null
...@@ -517,8 +518,9 @@ function showVersion(){ ...@@ -517,8 +518,9 @@ function showVersion(){
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
. "$( dirname $0 )/inc_functions.sh"
cat <<EOBANNER _echo "
______________________________________________________________________________________ ______________________________________________________________________________________
_______ __ _______ __
...@@ -536,8 +538,10 @@ ________________________________________________________________________________ ...@@ -536,8 +538,10 @@ ________________________________________________________________________________
______________________________________________________________________________________ ______________________________________________________________________________________
"
_log "Starting $_product $_version"
EOBANNER
if [ "$1" = "--cfg" ] && [ -n "$2" ]; then if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
echo "INFO: loading custom config [$2]..." echo "INFO: loading custom config [$2]..."
...@@ -546,7 +550,7 @@ if [ "$1" = "--cfg" ] && [ -n "$2" ]; then ...@@ -546,7 +550,7 @@ if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
else else
. "$( dirname $0 )/inc_getconfig.sh" . "$( dirname $0 )/inc_getconfig.sh"
fi fi
. "$( dirname $0 )/inc_functions.sh"
. "$( dirname $0 )/inc/rest-api-client.sh" . "$( dirname $0 )/inc/rest-api-client.sh"
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
# echo if there is an interactive shell # echo if there is an interactive shell
# params string(s) message to log # params string(s) message to log
function _echo(){ function _echo(){
test $isInteractiveShell && echo $* test $isInteractiveShell && echo "$*"
} }
# ====================================================================== # ======================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment