summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranweshadas <anwesha@das.community>2022-05-05 16:21:57 +0200
committeranweshadas <anwesha@das.community>2022-05-05 16:21:57 +0200
commitab44c6b0722da0a0532377297066f98ab75eccfc (patch)
tree8bec2c61d38388feaab2afbd3b0e105076847c72
Adds the basic monitoring code
-rw-r--r--monitor.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/monitor.sh b/monitor.sh
new file mode 100644
index 0000000..709372a
--- /dev/null
+++ b/monitor.sh
@@ -0,0 +1,17 @@
+ #!/bin/bash
+
+links=("https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-cosigned" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-to-cosign" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-leaves/0/1" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-consistency-proof/1/3")
+
+for url in ${links[@]};
+do
+echo $url
+ response=$(curl -s -w "%{http_code}" $url)
+ http_code=$(tail -n1 <<< "$response")
+ if [[ "$http_code" != 200 ]]; then
+ echo $url is down. status_code $http_code
+ else
+ echo $url is working. status_code $http_code
+ fi
+done
+
+