From 69f1acada9c8dccfb5d038ff647521b5d60e4c15 Mon Sep 17 00:00:00 2001 From: Maria Haider Date: Mon, 8 Jan 2024 17:17:37 +0100 Subject: [PATCH] added logic to check if execution of tests for more than two countries failed --- .../usr/lib/nagios/plugins/check_eidastest_prod.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/global/overlay/usr/lib/nagios/plugins/check_eidastest_prod.sh b/global/overlay/usr/lib/nagios/plugins/check_eidastest_prod.sh index 45cbeb3e..f4241350 100755 --- a/global/overlay/usr/lib/nagios/plugins/check_eidastest_prod.sh +++ b/global/overlay/usr/lib/nagios/plugins/check_eidastest_prod.sh @@ -38,6 +38,18 @@ if [ "$diff_exec_time" -gt "$day" ]; then fi +raw_not_executed_test=$(echo "$exec_status" | jq --raw-output '."last execution result".notExecutedTests[2]') + +declare -a not_executed_test=($(echo "$raw_not_executed_test" | tr "\n" " ")) + +#echo ${not_executed_test[*]} + +if [ "$not_executed_test" != null ] +then + echo "more than two lands not executed " + exit $STATE_CRITICAL +fi + raw_lands=$(echo "$exec_status" | jq --raw-output '."last execution result".failed[].result') raw_lands_result=$?