Navigation

Download CV (in Spanish) ↓esen

Socials

©Code by Bryan

NOC Incident Bot

Role

Design and development

Type

Incident follow-up bot for a NOC engineer

Stack

NOC Incident Bot

A bot that turns a NOC’s incident e-mails into Telegram threads with status buttons, a change history and a monitoring round every 2 hours.

The challenge

An operations (NOC) engineer at a telecom company asked me to automate his follow-up: alerts arrived by e-mail and the status of each incident got lost between conversations, so nobody knew at a glance what was still open.

What I built

A Python bot reads the inbox (Gmail API or IMAP, read-only), parses each alert and opens one thread per incident in the team’s Telegram group. Buttons change the status through a state machine that only allows valid transitions and authorized users, and every change is stored in SQLite with who and when. Every 2 hours it posts what is still pending. E-mails are processed once by Message-ID, the connection retries with backoff and secrets never reach the logs. I rebuilt it as an open-source project with a demo mode, Docker and tests.

From the alert e-mail to a Telegram thread, through a parser, SQLite and a state machine
From the alert e-mail to a Telegram thread, through a parser, SQLite and a state machine
29 tests: parser, state machine, idempotency, retries, commands and authorized users
29 tests: parser, state machine, idempotency, retries, commands and authorized users
The team’s group in Telegram (fictitious data)
The team’s group in Telegram (fictitious data)

Highlights

  1. 01/actualizar syncs the inbox and posts one thread per new incident
  2. 02Status buttons: in diagnosis, crew on the way, no coverage, service restored, pause, ticket closed
  3. 03Monitoring round every 2 hours that flags what has not changed
  4. 04Full history in SQLite: who changed what and when
  5. 05No duplicates (Message-ID), retries with backoff, authorized users only
  6. 06Demo mode with fictitious e-mails, Docker for 24/7 and 29 tests in CI

Built with

PythonTelegram Bot APIGmail API · IMAPSQLiteDockerpytestGitHub Actions
Code ↗