Kütüphane / İzleme, Operasyon ve Olaylar
İzleme, Operasyon ve Olaylar
Ollama ve Telegram onayıyla PostgreSQL engelleyen oturumların triyajı
Her 5 dakikada bir çalışarak PostgreSQL engelleyen oturumları bulur, yerel bir Ollama modelinden TERMINATE veya WAIT triyajı ister ve engelleyeni yalnızca Telegram onayından sonra sonlandırır.
Ne yapar
## 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.
Adımlar
- 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
Toplam 15 adım.
Benzer otomasyonlar
Veri Senkronizasyonu ve ETLPostgreSQL Tablosunu CSV Dosyasına Aktarma4 adımVeri Senkronizasyonu ve ETLPostgreSQL Tablosunu CSV Dosyasına Aktarma6 adımCRM ve Satış HattıPostgreSQL verileriyle müşteri kayıp riskini puanla ve Gemini ile Slack'i uyar17 adımRAG ve Bilgi BankalarıOllama Üzerinde Yerel Drive Bilgi Tabanıyla Sohbet Etme17 adım