Complete Ghaymah Internship Assessment

هذا الالتزام موجود في:
2026-07-27 19:30:45 +02:00
التزام 58dda08466
13 ملفات معدلة مع 899 إضافات و0 حذوفات

عرض الملف

@@ -0,0 +1,20 @@
#!/bin/bash
URL="http://localhost:8000/health"
echo "Starting Health Monitor..."
while true
do
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" $URL)
TIME=$(curl -s -o /dev/null -w "%{time_total}" $URL)
DATE=$(date +"%Y-%m-%d %H:%M:%S")
if [ "$RESPONSE" = "200" ]; then
echo "[$DATE] STATUS: UP | HTTP: $RESPONSE | Response Time: ${TIME}s"
else
echo "[$DATE] STATUS: DOWN | HTTP: $RESPONSE"
fi
sleep 30
done