Initial commit: agent_logwatch v1.0

- Réception logs MQTT depuis machines distantes (agents/logwatch/+/logs)
- Pré-filtrage sans LLM (14 patterns: ERROR, FATAL, OOM, segfault, auth fail...)
- Analyse LLM par créneau horaire configurable (APScheduler)
- Gestion round-robin avec reprise sur interruption
- Extension de créneau (+30 min) avec confirmation admin
- Skills: machine (gestion machines) + logwatch (contrôle)
- Script send_logs.sh pour machines distantes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 08:59:20 +00:00
commit bdcfff9f8e
20 changed files with 1618 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"""
Skill AGENTS_STATUS — afficher le statut en temps réel de tous les agents.
Usage LLM : SKILL:agents_status ARGS:
"""
DESCRIPTION = "Afficher le statut en temps réel de tous les agents (online/offline)"
USAGE = "SKILL:agents_status ARGS:(aucun argument)"
def run(args: str, context) -> str:
with context.agent._online_lock:
online = set(context.agent._online_agents)
all_caps = context.registry.all_agents()
if not all_caps:
return "Aucun agent connu dans le registre."
lines = ["── Statut des agents ──────────────────"]
for caps in sorted(all_caps, key=lambda c: c.agent_id):
if caps.agent_id == context.agent_id:
continue # Ne pas s'afficher soi-même
icon = "🟢" if caps.agent_id in online else "🔴"
label = "en ligne" if caps.agent_id in online else "hors ligne"
lines.append(f" {icon} {caps.agent_id} [{caps.agent_type}] — {label}")
lines.append(f" {caps.description}")
return "\n".join(lines) if len(lines) > 1 else "Aucun autre agent connu."