00c2f9203a
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
111 lines
2.7 KiB
Markdown
111 lines
2.7 KiB
Markdown
# Agent2_Debian13 — Spécialiste Debian
|
|
|
|
Agent spécialisé dans l'administration de systèmes Debian. Reçoit ses tâches d'agent1 via MQTT et peut aussi être contacté directement par l'utilisateur via XMPP.
|
|
|
|
## Rôle
|
|
|
|
- Administration système Debian (paquets, services, réseau, sécurité)
|
|
- Exécution de commandes shell sur le système hôte
|
|
- Rapporte les résultats à agent1 via MQTT
|
|
|
|
## Skills disponibles
|
|
|
|
| Trigger | Description |
|
|
|---|---|
|
|
| `EXEC: <commande>` | Exécution de commande shell (timeout 30s) |
|
|
| `SEARCH: <requête>` | Recherche DuckDuckGo |
|
|
| `READ: <url>` | Lecture de page web |
|
|
| `REMEMBER: <clé> \| <valeur>` | Mémoire SQLite |
|
|
| `RECALL: <clé>` | Récupération mémoire |
|
|
| `MQTT_PUBLISH: <topic> \| <msg>` | Publication MQTT |
|
|
|
|
## Exemples de tâches
|
|
|
|
```
|
|
EXEC: systemctl status nginx
|
|
EXEC: apt list --upgradable
|
|
EXEC: journalctl -u ssh --no-pager -n 20
|
|
EXEC: df -h
|
|
EXEC: docker ps -a
|
|
```
|
|
|
|
## Déploiement via agent2_deploy (recommandé)
|
|
|
|
Depuis agent1, demander à agent2_deploy de déployer cet agent :
|
|
|
|
```
|
|
# Via XMPP avec sylvain@xmpp.ovh :
|
|
!deploy
|
|
# Suivre le guide interactif
|
|
```
|
|
|
|
## Déploiement manuel
|
|
|
|
```bash
|
|
# Prérequis
|
|
apt-get install -y python3 python3-pip python3-venv git
|
|
|
|
# Cloner et installer
|
|
git clone https://git.piaf.im/sylvain/agent2_debian13.git /opt/agent2_debian13
|
|
cd /opt/agent2_debian13
|
|
python3 -m venv venv
|
|
venv/bin/pip install slixmpp paho-mqtt requests ddgs beautifulsoup4 chromadb
|
|
|
|
# Configurer
|
|
nano config/config.json
|
|
|
|
# Service systemd
|
|
cat > /etc/systemd/system/agent2_debian13.service << 'EOF'
|
|
[Unit]
|
|
Description=Agent2 Debian13
|
|
After=network.target mosquitto.service
|
|
Wants=mosquitto.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/agent2_debian13
|
|
ExecStart=/usr/bin/python3 /opt/agent2_debian13/agent2_debian13.py
|
|
Restart=always
|
|
RestartSec=5
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable agent2_debian13
|
|
systemctl start agent2_debian13
|
|
```
|
|
|
|
## Déploiement depuis le dépôt git (sur la machine cible)
|
|
|
|
```bash
|
|
git clone https://git.piaf.im/sylvain/agent2_deploy.git /tmp/agent2_deploy
|
|
python3 /tmp/agent2_deploy/deploy.py --local agent2_debian13
|
|
```
|
|
|
|
## Configuration (`config/config.json`)
|
|
|
|
```json
|
|
{
|
|
"ollama_url" : "http://<ip_ollama>:11434/api/chat",
|
|
"model" : "qwen3:8b",
|
|
"xmpp_jid" : "agent2_debian13@xmpp.ovh",
|
|
"xmpp_pass" : "<mot_de_passe>",
|
|
"admin_jid" : "sylvain@xmpp.ovh",
|
|
"mqtt_host" : "<ip_broker_mqtt>",
|
|
"mqtt_port" : 1883,
|
|
"mqtt_client_id" : "agent2_debian13",
|
|
"mqtt_inbox" : "agents/agent2_debian13/inbox",
|
|
"mqtt_outbox" : "agents/agent1/inbox"
|
|
}
|
|
```
|
|
|
|
## Logs
|
|
|
|
```bash
|
|
journalctl -u agent2_debian13 -f
|
|
```
|