diff --git a/Dockerfile b/Dockerfile index 96bfa3e..4423851 100755 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,6 @@ RUN python3 -m venv /app/venv && \ mkdir -p /app/logs HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD pgrep python > /dev/null && ! (find /app/logs -name "app.log.*" -exec tail -n 20 {} \; 2>/dev/null | grep -E "ERROR|CRITICAL|Exception") || exit 1 + CMD pgrep python > /dev/null && ! (tail -n 20 /app/logs/$(hostname).log 2>/dev/null | grep -E "ERROR|CRITICAL|Exception|sqlite3\.OperationalError") || exit 1 CMD ["/start.sh"] diff --git a/zabbix_agent2.conf b/zabbix_agent2.conf deleted file mode 100644 index 4b6cfbe..0000000 --- a/zabbix_agent2.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Configuration Zabbix Agent 2 pour Mamie Henrriette Bot - -# Serveur Zabbix -Server=zabbix-server.example.com -ServerActive=zabbix-server.example.com:10051 - -# Configuration de l'agent -Hostname=MamieHenriette -ListenPort=10050 -ListenIP=0.0.0.0 - -# Logs -LogType=console -LogLevel=3 -DebugLevel=3 - -# Timeout -Timeout=30 - -# Métriques personnalisées pour le bot Discord -UserParameter=discord.bot.status,python3 /app/bot_status.py -UserParameter=discord.bot.uptime,cat /proc/uptime | awk '{print $1}' -UserParameter=discord.bot.memory,ps -o pid,vsz,rss,comm -p $(pgrep -f bot.py) | tail -1 | awk '{print $3}' - -# Surveillance des logs -UserParameter=discord.bot.errors,grep -c "ERROR" /var/log/discord-bot.log 2>/dev/null || echo 0 -UserParameter=discord.bot.warnings,grep -c "WARNING" /var/log/discord-bot.log 2>/dev/null || echo 0 \ No newline at end of file