Files
dyolink/infrastructure/scripts/logs.sh
Admin 26bd35ae3c Initial commit: Full project structure
- Backend: NestJS with Docker
- Frontend: Next.js with Docker
- Nginx configuration for reverse proxy
- PostgreSQL setup
- Docker compose for orchestration
- Development environment configuration
2026-04-23 15:33:11 +03:30

32 lines
893 B
Bash

#!/bin/bash
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
echo "=== Dyolink Health Monitor ==="
echo "Time: $(date)"
echo ""
# Check containers
echo "Container Status:"
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Health}}" | grep dyolink
# Check resources
echo -e "\nResource Usage:"
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | grep dyolink
# Check disk
DISK=$(df -h / | awk 'NR==2 {print $5}' | tr -d '%')
if [ $DISK -gt 80 ]; then
echo -e "\n${RED}⚠ WARNING: Disk usage at ${DISK}%${NC}"
else
echo -e "\n${GREEN}✓ Disk usage: ${DISK}%${NC}"
fi
# Check API
echo -e "\nAPI Health:"
curl -s -o /dev/null -w "Backend API: %{http_code}\n" http://localhost:3001/api/health || echo "Backend API: DOWN"
curl -s -o /dev/null -w "Frontend: %{http_code}\n" http://localhost:3002 || echo "Frontend: DOWN"