Bibliothek / Monitoring, Betrieb & Störungen
Monitoring, Betrieb & Störungen
PostgreSQL-Blockierungssitzungen mit Ollama triagieren und per Telegram-Freigabe
Läuft alle 5 Minuten, sucht PostgreSQL-Blockierungssitzungen, fragt ein lokales Ollama-Modell nach einer TERMINATE- oder WAIT-Triage und beendet den Blocker erst nach Telegram-Freigabe.
Was sie bewirkt
## Triage PostgreSQL blocking sessions with Ollama and Telegram approval ### How it works Every 5 minutes the workflow looks for blocking sessions in PostgreSQL and groups them into one proposal per blocker. It retrieves the applicable severity criterion from a pgvector knowledge base, asks a local Ollama model for a triage (TERMINATE or WAIT) and writes the proposal to an append-only audit log. A Telegram message then asks a human to approve or reject: on approval the blocking session is terminated and the outcome is notified, otherwise the rejection is logged. The AI proposes, a human signs off, the database records. The guardrails live in the database, not in the workflow. ### Setup steps - Run the one-time database setup described in the Prerequisites note. - Create two Postgres credentials on the monitored database: user ai_monitor (all Postgres nodes except one) and user ai_action (only Terminate Session). - Create a Telegram credential with your bot token and assign it to the two Telegram nodes. - In Set Configuration Parameters fill in chatId, approver, ollamaUrl and, if needed, model and embeddingModel. - Pull the two Ollama models (llama3.2:3b, nomic-embed-text) and make sure n8n can reach Ollama. - n8n must be reachable from the approver's device, because the Approve / Reject buttons open the n8n webhook URL. ### Customization Change the schedule, the 30-minute window that avoids repeated proposals, the severity criteria in the knowledge base, the prompt or the Ollama model.
Die Schritte
- Every 5 Minutes
- Set Configuration Parameters
- Query Blocking Sessions
- Group by Blocking Session
- Post to Ollama API
- Validate Ollama Response
- Log Proposed Sessions
- Approve or Reject via Telegram
- If Approved
- Terminate Session
- Notify Outcome on Telegram
- Log Rejected Sessions
- Post Situation Embedding
- Search Criteria in Vector DB
Insgesamt 15 Schritte.
Ähnliche Automatisierungen
Datensynchronisierung & ETLPostgreSQL-Tabelle in eine CSV-Datei exportieren4 SchritteDatensynchronisierung & ETLPostgreSQL-Tabelle in eine CSV-Datei exportieren6 SchritteCRM & VertriebspipelineKundenabwanderungsrisiko aus PostgreSQL-Daten bewerten und Slack mit Gemini benachrichtigen17 SchritteRAG & WissensdatenbankenMit einer lokalen Drive-Wissensbasis auf Ollama chatten17 Schritte