From 00ffe221ec97c1f3484fd8a6aae9401b2564f24b Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Wed, 6 Sep 2023 11:24:31 +0200 Subject: [PATCH] check_http add param -c --- check_http | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check_http b/check_http index e035bf6..81a1c79 100755 --- a/check_http +++ b/check_http @@ -48,6 +48,7 @@ PARAMETERS: Define request: -u URL Set url to fetch; eg. https://www.example.com/ -m METHOD Set a method, eg. HEAD; default: GET + -c PARAMS additional curl params What to check: -s STATUSCODE exact Statuscode to check; 3 digits; by default critical @@ -102,6 +103,7 @@ ph.require "curl" sUrl=$( ph.getValueWithParam '' u "$@") sMethod=$( ph.getValueWithParam 'GET' m "$@" | tr [:lower:] [:upper:]) +curlParams=$( ph.getValueWithParam '' c "$@") iStatus=$( ph.getValueWithParam '' s "$@") sHeader=$( ph.getValueWithParam '' r "$@") @@ -111,7 +113,10 @@ sJq=$( ph.getValueWithParam '' j "$@") sLabel=$( ph.getValueWithParam "" l "$@") -curlParams="-si -X $sMethod" +curlParams+=" -si -X $sMethod" + +# echo "Url is $sUrl" + sProblems= sOK= -- GitLab