From 19cb5996b13eef6e27a95ea3063e4b9af09a7544 Mon Sep 17 00:00:00 2001 From: Maria Haider Date: Tue, 4 Oct 2022 14:53:09 +0200 Subject: [PATCH] nagios check for eidastest Ref: SC-628 --- .../plugins/check_eidas_eidastest_qa.sh | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 global/overlay/usr/lib/nagios/plugins/check_eidas_eidastest_qa.sh diff --git a/global/overlay/usr/lib/nagios/plugins/check_eidas_eidastest_qa.sh b/global/overlay/usr/lib/nagios/plugins/check_eidas_eidastest_qa.sh new file mode 100755 index 00000000..fe2dff1f --- /dev/null +++ b/global/overlay/usr/lib/nagios/plugins/check_eidas_eidastest_qa.sh @@ -0,0 +1,32 @@ +#!/bin/bash + + +raw_lands=$(curl -s https://api.swedenconnect.se/testid/qa/execution-status | jq --raw-output '."last execution result".failed[].result') + +declare -a lands=($(echo $raw_lands | tr "\n" " ")) + +exit_status=0 +output="" + +for land in "${lands[@]}" +do + if [[ "$land" == XA* ]] + then + exit_status=1 + output="$output $land test country failing" + fi + if [[ "$land" == XB* ]] + then + exit_status=1 + output="$output $land test country failing" + fi +done + +if [ "$exit_status" -gt 0 ] +then + echo $output +else + echo "Tests on test lands are error free" +fi + +exit 0