{"id":38178168,"url":"https://github.com/little-angry-clouds/alertmanager-actions","last_synced_at":"2026-01-16T23:38:37.119Z","repository":{"id":48859493,"uuid":"251223827","full_name":"little-angry-clouds/alertmanager-actions","owner":"little-angry-clouds","description":"Launch custom actions based on Alertmanager alerts","archived":false,"fork":false,"pushed_at":"2021-08-23T11:52:50.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-09T07:41:30.848Z","etag":null,"topics":["alertmanager-webhook","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/little-angry-clouds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T06:45:50.000Z","updated_at":"2022-05-10T10:04:41.000Z","dependencies_parsed_at":"2022-09-12T14:04:35.433Z","dependency_job_id":null,"html_url":"https://github.com/little-angry-clouds/alertmanager-actions","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/little-angry-clouds/alertmanager-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Falertmanager-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Falertmanager-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Falertmanager-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Falertmanager-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/little-angry-clouds","download_url":"https://codeload.github.com/little-angry-clouds/alertmanager-actions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Falertmanager-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-webhook","prometheus"],"created_at":"2026-01-16T23:38:36.581Z","updated_at":"2026-01-16T23:38:37.109Z","avatar_url":"https://github.com/little-angry-clouds.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alertmanager Actions\n\n![Test](https://github.com/little-angry-clouds/alertmanager-actions/workflows/Test%20and%20build%20docker/badge.svg)\n[![Coverage\nStatus](https://coveralls.io/repos/github/little-angry-clouds/alertmanager-actions/badge.svg?branch=master)](https://coveralls.io/github/little-angry-clouds/alertmanager-actions?branch=master)\n[![Total\nalerts](https://img.shields.io/lgtm/alerts/g/little-angry-clouds/alertmanager-actions.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/little-angry-clouds/alertmanager-actions/alerts/)\n[![Language grade:\nPython](https://img.shields.io/lgtm/grade/python/g/little-angry-clouds/alertmanager-actions.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/little-angry-clouds/alertmanager-actions/context:python)\n\nAn Alert Manager\n[receiver](https://prometheus.io/docs/alerting/configuration/#receiver) that\nexecutes arbitrary commands when receiving alerts.\n\nIt's dead simple. You associate alert labels to an action, and it will execute\nthe action.\n\n## Configuration\nThis program uses [pyms](https://github.com/python-microservices/pyms), the cool\nlibrary to create REST python microservices. The configuration section under\n`pyms` is for that. The one under `alertmanager_actions` is the section for the\nprogram per se:\n\n``` yaml\npyms:\n  services:\n    metrics: true\n  config:\n    debug: false\n    app_name: alertmanager-actions\n    testing: false\nalertmanager_actions:\n  - labels:\n      alertname: IpsecStatus\n      action: restart\n    command: hostname\n```\n\nYou may use this to execute commands over ssh, like this:\n\n``` yaml\npyms:\n  services:\n    metrics: true\n  config:\n    debug: false\n    app_name: alertmanager-actions\n    testing: false\nalertmanager_actions:\n  - labels:\n      alertname: ExampleAlertName\n      action: restart\n    command: ssh -i /home/user/.ssh/id_rsa user@mycoolbox.com hostname\n```\n\nIt's possible to read a more complete step by step documentation\n[here](./docs/configuration.md).\n\nAlso, there's a docker image you may use in [Docker\nHub](https://hub.docker.com/repository/docker/littleangryclouds/alertmanager-actions).\n\n## Metrics\nIt exposes some prometheus metrics. The ones that come with\n[Pyms](https://py-ms.readthedocs.io/en/latest/services/#metrics)\nand then ones about the Alertmanager Actions itself. The created metric would be\nsomething like this:\n\n``` text\n# HELP alertmanager_actions_total Number of alertmanager actions executions\n# TYPE alertmanager_actions_total counter\nalertmanager_actions_total{action=\"TestActions\",alertname=\"TestActions\",state=\"0\"} 1.0\nalertmanager_actions_total{action=\"TestActions\",alertname=\"TestActions\",state=\"1\"} 1.0\n# HELP alertmanager_actions_created Number of alertmanager actions executions\n# TYPE alertmanager_actions_created gauge\nalertmanager_actions_created{action=\"TestActions\",alertname=\"TestActions\",state=\"0\"} 1.5936252529745235e+09\nalertmanager_actions_created{action=\"TestActions\",alertname=\"TestActions\",state=\"1\"} 1.5936252952259927e+09\n```\n\nThe metric's name is `alertmanager_actions_executions` and will have the next\nmetrics:\n- action: The action name.\n- state: The state of the executed command. 0 means that it worked correctly, 1\n  that it didn't.\n- arbitrary labels: There will also be added all the labels that are used to\n  identify the action. Following the above example, the next labels will be\n  added:\n  - alertname: ExampleAlertName\n  - action: restart\n\n## Development\n### Tests\n\n``` bash\npipenv install\npipenv run pip freeze \u003e requirements.txt\ntox\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-angry-clouds%2Falertmanager-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittle-angry-clouds%2Falertmanager-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-angry-clouds%2Falertmanager-actions/lists"}