{"id":26055752,"url":"https://github.com/nopp/alertmanager-webhook-telegram-python","last_synced_at":"2025-04-11T03:15:16.033Z","repository":{"id":54935364,"uuid":"119525261","full_name":"nopp/alertmanager-webhook-telegram-python","owner":"nopp","description":"Simple webhook - Alertmanager to telegram (python version)","archived":false,"fork":false,"pushed_at":"2023-10-02T14:29:19.000Z","size":60,"stargazers_count":54,"open_issues_count":1,"forks_count":65,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T03:15:11.806Z","etag":null,"topics":["alertmanager","alertmanager-webhook","flask","hacktoberfest","prometheus","telegram","webhook"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"carlosmalucelli"}},"created_at":"2018-01-30T11:14:51.000Z","updated_at":"2025-03-14T14:56:56.000Z","dependencies_parsed_at":"2023-01-20T11:15:30.059Z","dependency_job_id":null,"html_url":"https://github.com/nopp/alertmanager-webhook-telegram-python","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopp%2Falertmanager-webhook-telegram-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopp%2Falertmanager-webhook-telegram-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopp%2Falertmanager-webhook-telegram-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopp%2Falertmanager-webhook-telegram-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopp","download_url":"https://codeload.github.com/nopp/alertmanager-webhook-telegram-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333594,"owners_count":21086200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alertmanager","alertmanager-webhook","flask","hacktoberfest","prometheus","telegram","webhook"],"created_at":"2025-03-08T10:21:12.906Z","updated_at":"2025-04-11T03:15:16.014Z","avatar_url":"https://github.com/nopp.png","language":"Python","funding_links":["https://patreon.com/carlosmalucelli"],"categories":[],"sub_categories":[],"readme":"# Alertmanager webhook for Telegram (Python Version)\n\n![Docker Image CI](https://github.com/nopp/alertmanager-webhook-telegram-python/workflows/Docker%20Image%20CI/badge.svg)\n![Code scanning - action](https://github.com/nopp/alertmanager-webhook-telegram-python/workflows/Code%20scanning%20-%20action/badge.svg)\n\nGO Version (https://github.com/nopp/alertmanager-webhook-telegram-go)\n\nPython version 3\n\n## INSTALL\n\n* pip install -r requirements.txt\n\nChange on flaskAlert.py\n=======================\n* botToken\n* chatID\n\nIf you'll use with authentication, change too\n\n* XXXUSERNAME\n* XXXPASSWORD\n\nDisabling authentication\n========================\nOn flaskAlert.py change app.config['BASIC_AUTH_FORCE'] = True to app.config['BASIC_AUTH_FORCE'] = False\n\nAlertmanager configuration example\n==================================\n\n\treceivers:\n\t- name: 'telegram-webhook'\n\t  webhook_configs:\n\t  - url: http://ipFlaskAlert:9119/alert\n\t    send_resolved: true\n\t    http_config:\n\t      basic_auth:\n\t\tusername: 'admin'\n\t\tpassword: 'password'\n\nOne way to get the chat ID\n==========================\n1) Access https://web.telegram.org/\n2) Click to specific chat to the left\n3) At the url, you can get the chat ID(Ex: https://web.telegram.org/#/im?p=g1234567, so the chatID is 1234567)\n\nRunning\n=======\n* python flaskAlert.py\n\nRunning on docker\n=================\n    git clone https://github.com/nopp/alertmanager-webhook-telegram.git\n    cd alertmanager-webhook-telegram/docker/\n    docker build -t alertmanager-webhook-telegram:1.0 .\n\n    docker run -d --name telegram-bot \\\n    \t-e \"bottoken=telegramBotToken\" \\\n    \t-e \"chatid=telegramChatID\" \\\n    \t-e \"username=\u003cusername\u003e\" \\\n    \t-e \"password=\u003cpassword\u003e\" \\\n    \t-p 9119:9119 alertmanager-webhook-telegram:1.0\n\nExample to test\n===============\n\tcurl -XPOST --data '{\"status\":\"resolved\",\"groupLabels\":{\"alertname\":\"instance_down\"},\"commonAnnotations\":{\"description\":\"i-0d7188fkl90bac100 of job ec2-sp-node_exporter has been down for more than 2 minutes.\",\"summary\":\"Instance i-0d7188fkl90bac100 down\"},\"alerts\":[{\"status\":\"resolved\",\"labels\":{\"name\":\"olokinho01-prod\",\"instance\":\"i-0d7188fkl90bac100\",\"job\":\"ec2-sp-node_exporter\",\"alertname\":\"instance_down\",\"os\":\"linux\",\"severity\":\"page\"},\"endsAt\":\"2019-07-01T16:16:19.376244942-03:00\",\"generatorURL\":\"http://pmts.io:9090\",\"startsAt\":\"2019-07-01T16:02:19.376245319-03:00\",\"annotations\":{\"description\":\"i-0d7188fkl90bac100 of job ec2-sp-node_exporter has been down for more than 2 minutes.\",\"summary\":\"Instance i-0d7188fkl90bac100 down\"}}],\"version\":\"4\",\"receiver\":\"infra-alert\",\"externalURL\":\"http://alm.io:9093\",\"commonLabels\":{\"name\":\"olokinho01-prod\",\"instance\":\"i-0d7188fkl90bac100\",\"job\":\"ec2-sp-node_exporter\",\"alertname\":\"instance_down\",\"os\":\"linux\",\"severity\":\"page\"}}' http://username:password@flaskAlert:9119/alert\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopp%2Falertmanager-webhook-telegram-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopp%2Falertmanager-webhook-telegram-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopp%2Falertmanager-webhook-telegram-python/lists"}