nagios check for eidastest

Ref: SC-628
This commit is contained in:
Maria Haider 2022-10-04 14:53:09 +02:00
parent 5822eda8b7
commit 19cb5996b1
Signed by: mariah
GPG key ID: 7414A760CA747E57

View file

@ -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