48 lines
1.1 KiB
Bash
Executable file
48 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/sh
|
|
|
|
set -e
|
|
cd /opt/ || exit
|
|
|
|
hc_url="https://hc-ping.com/$HTTP_HC_UID"
|
|
error=""
|
|
|
|
alias curl_hc='curl -LA "$USER_AGENT" --retry 3'
|
|
|
|
check_url ()
|
|
{
|
|
url="https://$1"
|
|
echo "checking url $url ..."
|
|
dig A "$1" >/dev/null
|
|
if curl_hc -sSf "$url" >/dev/null 2>&1
|
|
then
|
|
echo "... good"
|
|
else
|
|
result=$(curl -Lv "$url" 2>&1)
|
|
error=$(printf "%s\n==========\n%s:\n%s" "$error" "$url" "$result")
|
|
echo "... bad"
|
|
fi
|
|
}
|
|
|
|
check_url "analytics.serguzim.me"
|
|
check_url "auth.serguzim.me"
|
|
check_url "ci.serguzim.me"
|
|
check_url "cloud.serguzim.me"
|
|
check_url "git.serguzim.me"
|
|
check_url "graph.serguzim.me"
|
|
check_url "hook.serguzim.me"
|
|
check_url "mail.serguzim.me"
|
|
#check_url "msrg.cc" # disabled because it keeps creating false alerts
|
|
check_url "prometheus.serguzim.me/-/healthy"
|
|
check_url "registry.serguzim.me/account/sign-in"
|
|
check_url "rss.serguzim.me"
|
|
#check_url "serguzim.me" # disabled because it keeps creating false alerts
|
|
check_url "tick.serguzim.me"
|
|
check_url "wiki.serguzim.me"
|
|
check_url "www.reitanlage-oranienburg.de"
|
|
|
|
if [ "$error" = "" ]
|
|
then
|
|
curl_hc "$hc_url"
|
|
else
|
|
curl_hc --data-raw "$error" "$hc_url/fail"
|
|
fi
|