Update monitor.yml
This commit is contained in:
parent
f643018478
commit
bb7f51f514
90
.github/workflows/monitor.yml
vendored
90
.github/workflows/monitor.yml
vendored
@ -1,49 +1,49 @@
|
|||||||
name: Monitor Lab URLs
|
# name: Monitor Lab URLs
|
||||||
|
|
||||||
on:
|
# on:
|
||||||
schedule:
|
# schedule:
|
||||||
- cron: "*/5 * * * *"
|
# - cron: "*/5 * * * *"
|
||||||
workflow_dispatch:
|
# workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
# jobs:
|
||||||
monitor:
|
# monitor:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
- name: Check services
|
# - name: Check services
|
||||||
run: |
|
# run: |
|
||||||
check_url() {
|
# check_url() {
|
||||||
URL=$1
|
# URL=$1
|
||||||
NAME=$2
|
# NAME=$2
|
||||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
|
# STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
|
||||||
TIME=$(date "+%Y-%m-%d %H:%M:%S")
|
# TIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
if [[ "$STATUS" == "502" || "$STATUS" == "404" ]]; then
|
# if [[ "$STATUS" == "502" || "$STATUS" == "404" ]]; then
|
||||||
curl -s \
|
# curl -s \
|
||||||
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
# --form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
||||||
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
# --form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
||||||
--form-string "title=🔴 $NAME Alert" \
|
# --form-string "title=🔴 $NAME Alert" \
|
||||||
--form-string "message=⚠️ $URL is down ($STATUS) at $TIME" \
|
# --form-string "message=⚠️ $URL is down ($STATUS) at $TIME" \
|
||||||
--form-string "priority=2" \
|
# --form-string "priority=2" \
|
||||||
--form-string "retry=60" \
|
# --form-string "retry=60" \
|
||||||
--form-string "expire=600" \
|
# --form-string "expire=600" \
|
||||||
https://api.pushover.net/1/messages.json
|
# https://api.pushover.net/1/messages.json
|
||||||
else
|
# else
|
||||||
echo "✅ $NAME is up: $STATUS"
|
# echo "✅ $NAME is up: $STATUS"
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
check_url "https://git.dvirlabs.com" "git"
|
# check_url "https://git.dvirlabs.com" "git"
|
||||||
check_url "https://harbor.dvirlabs.com" "harbor"
|
# check_url "https://harbor.dvirlabs.com" "harbor"
|
||||||
check_url "https://wiki.dvirlabs.com" "wiki"
|
# check_url "https://wiki.dvirlabs.com" "wiki"
|
||||||
check_url "https://vault.dvirlabs.com" "vault"
|
# check_url "https://vault.dvirlabs.com" "vault"
|
||||||
check_url "https://woodpecker.dvirlabs.com" "woodpecker"
|
# check_url "https://woodpecker.dvirlabs.com" "woodpecker"
|
||||||
check_url "https://minio.dvirlabs.com" "minio"
|
# check_url "https://minio.dvirlabs.com" "minio"
|
||||||
check_url "https://grafana.dvirlabs.com" "grafana"
|
# check_url "https://grafana.dvirlabs.com" "grafana"
|
||||||
check_url "https://kibana-int.dvirlabs.com" "kibana-int"
|
# check_url "https://kibana-int.dvirlabs.com" "kibana-int"
|
||||||
check_url "https://kibana.dvirlabs.com" "kibana"
|
# check_url "https://kibana.dvirlabs.com" "kibana"
|
||||||
check_url "https://alertmanager.dvirlabs.com" "alertmanager"
|
# check_url "https://alertmanager.dvirlabs.com" "alertmanager"
|
||||||
check_url "https://grafana.dvirlabs.com" "grafana"
|
# check_url "https://grafana.dvirlabs.com" "grafana"
|
||||||
check_url "https://prometheus.dvirlabs.com" "prometheus"
|
# check_url "https://prometheus.dvirlabs.com" "prometheus"
|
||||||
check_url "https://prometheus.dvirlabs.com" "prometheus"
|
# check_url "https://prometheus.dvirlabs.com" "prometheus"
|
||||||
check_url "https://prometheus-int.dvirlabs.com" "prometheus-int"
|
# check_url "https://prometheus-int.dvirlabs.com" "prometheus-int"
|
||||||
check_url "https://kuma.dvirlabs.com" "kuma"
|
# check_url "https://kuma.dvirlabs.com" "kuma"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user