الملفات
2026-07-28 13:34:58 +03:00

22 أسطر
615 B
Bash

#!/bin/bash
# Replace this with your actual deployed Ghaymah URL
API_URL="https://bebars-64f19cdda81b.hosted.ghaymah.systems/health"
echo "Starting monitoring for $API_URL..."
echo "Press [CTRL+C] to stop."
while true; do
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
# Fetch only the HTTP status code
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}" "$API_URL")
if [ "$HTTP_STATUS" -eq 200 ]; then
echo "[$TIMESTAMP] ✅ Status: $HTTP_STATUS - App is HEALTHY"
else
echo "[$TIMESTAMP] ❌ Status: $HTTP_STATUS - App is DOWN or UNREACHABLE"
fi
sleep 30
done