From f4b75773928c1196bb92fbc430d20f8039c69f4a Mon Sep 17 00:00:00 2001 From: anweshadas Date: Thu, 12 May 2022 10:56:48 +0200 Subject: Adds better fail message for get-inclusion-proof --- scripts/monitor.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/monitor.sh b/scripts/monitor.sh index 01f4adc..3abb8dc 100755 --- a/scripts/monitor.sh +++ b/scripts/monitor.sh @@ -105,10 +105,11 @@ function check_inclusion_proof() { desc="GET get-inclusion-proof (tree_size $1, data \"$2\")" signature=$(echo $2 | sigsum-debug leaf sign -k $cli_priv -h $ssrv_shard_start) leaf_hash=$(echo $2 | sigsum-debug leaf hash -k $cli_key_hash -s $signature -h $ssrv_shard_start) - curl -s -w "%{http_code}" $log_url/get-inclusion-proof/$1/$leaf_hash >$log_dir/rsp + api=$log_url/get-inclusion-proof/$1/$leaf_hash + curl -s -w "%{http_code}" $api >$log_dir/rsp cp $log_dir/rsp $log_dir/rsp_get_inclusion_proof status_code=$(tail -n1 < $log_dir/rsp) - api=$log_url/get-inclusion-proof + if [[ $status_code != 200 ]]; then msg="$(date +"%y-%m-%d %H:%M:%S %Z") Warning: $api is down with status_code $status_code" # Failure message -- cgit v1.2.3