Bot Telegram
Bot pour recevoir alertes et contrôler l'infrastructure.
Configuration
1. Créer le bot
- Ouvrir @BotFather sur Telegram
- Envoyer
/newbot - Nom:
EFC Info Bot - Username:
EFCInfoBot - Copier le token
2. Obtenir Chat ID
- Ouvrir @userinfobot
- Envoyer
/start - Copier le Chat ID
3. Configurer secrets.env
TELEGRAM_BOT_TOKEN=123456:ABC...
TELEGRAM_CHAT_ID=987654321
Démarrage
cd ~/.efc/telegram-bot
npm start
Commandes Telegram
| Commande | Description |
|---|---|
/start | Message de bienvenue |
/status | Status infrastructure |
/vpn | Peers VPN |
/servers | Ping serveurs |
/docs | Status documentation |
/alerts on | Activer alertes |
/alerts off | Désactiver alertes |
Service de monitoring
Le fichier monitor.js surveille:
- Serveurs (ping)
- Documentation périmée
node monitor.js
Alertes
Les alertes sont envoyées automatiquement pour:
- Serveur down (3 échecs consécutifs)
- Documentation > 30 jours