Complete all exam tasks
هذا الالتزام موجود في:
16
q1-deploy-monitor/health-check.sh
Normal file → Executable file
16
q1-deploy-monitor/health-check.sh
Normal file → Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
URL="http://localhost:8000/health"
|
||||
|
||||
while true
|
||||
do
|
||||
response=$(curl -s -o /dev/null -w "%{http_code}" $URL)
|
||||
|
||||
if [ "$response" -eq 200 ]; then
|
||||
echo "$(date): Application is UP"
|
||||
else
|
||||
echo "$(date): Application is DOWN"
|
||||
fi
|
||||
|
||||
sleep 30
|
||||
done
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم