summaryrefslogtreecommitdiff
path: root/Omni/Sentry.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-11-15 14:55:37 -0500
committerBen Sima <ben@bsima.me>2024-12-21 10:06:49 -0500
commit6513755670892983db88a6633b8c1ea6019c03d1 (patch)
tree44e9eccdb7a3a74ab7e96a8fee7572dd6a78dc73 /Omni/Sentry.sh
parentae7b7e0186b5f2e0dcd4d5fac0a71fa264caedc2 (diff)
Re-namespace some stuff to Omni
I was getting confused about what is a product and what is internal infrastructure; I think it is good to keep those things separate. So I moved a bunch of stuff to an Omni namespace, actually most stuff went there. Only things that are explicitly external products are still in the Biz namespace.
Diffstat (limited to 'Omni/Sentry.sh')
-rwxr-xr-xOmni/Sentry.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/Omni/Sentry.sh b/Omni/Sentry.sh
new file mode 100755
index 0000000..5c9e0ac
--- /dev/null
+++ b/Omni/Sentry.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+#
+# monitors our infrastructure
+#
+#
+# color codes for use with printf
+ export RED='\033[0;31m'
+ export GRN='\033[0;32m'
+ export YEL='\033[0;33m'
+ export NC='\033[0m' # No Color
+#
+ while true
+ do
+ clear
+ printf "%s sentry\n\n" "$(date +%Y.%m.%d..%H.%M)"
+ urls=(
+ http://que.run
+ https://dragons.dev
+ https://simatime.com
+ https://tv.simatime.com
+ https://bsima.me
+ # https://herocomics.app
+ )
+ for url in "${urls[@]}"
+ do
+ code=$(curl -L --max-time 10 --silent --show-error --insecure \
+ --output /dev/null \
+ --write-out "%{http_code}" "$url")
+ case "$code" in
+ 2[0-9][0-9]) color=${GRN};;
+ 3[0-9][0-9]) color=${YEL};;
+ 4[0-9][0-9]) color=${YEL};;
+ 5[0-9][0-9]) color=${RED};;
+ *) color=${RED};;
+ esac
+ printf "%b%s %s%b\n" "$color" "$code" "$url" "$NC"
+ done
+ sleep 120
+ done
+##