intial commit
هذا الالتزام موجود في:
22
q1-deploy-monitor/monitor.sh
Normal file
22
q1-deploy-monitor/monitor.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
المرجع في مشكلة جديدة
حظر مستخدم