{"id":28394974,"url":"https://github.com/ouqiang/supervisor-event-listener","last_synced_at":"2026-03-08T09:37:16.240Z","repository":{"id":57485018,"uuid":"93243399","full_name":"ouqiang/supervisor-event-listener","owner":"ouqiang","description":"Supervisor事件通知, 支持邮件, Slack, WebHook","archived":false,"fork":false,"pushed_at":"2021-09-09T11:24:43.000Z","size":65,"stargazers_count":114,"open_issues_count":2,"forks_count":60,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-01T06:31:59.483Z","etag":null,"topics":["event-handler","supervisor"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ouqiang.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":"2017-06-03T11:19:23.000Z","updated_at":"2024-11-26T14:32:03.000Z","dependencies_parsed_at":"2022-08-26T11:11:05.057Z","dependency_job_id":null,"html_url":"https://github.com/ouqiang/supervisor-event-listener","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ouqiang/supervisor-event-listener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ouqiang%2Fsupervisor-event-listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ouqiang%2Fsupervisor-event-listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ouqiang%2Fsupervisor-event-listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ouqiang%2Fsupervisor-event-listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ouqiang","download_url":"https://codeload.github.com/ouqiang/supervisor-event-listener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ouqiang%2Fsupervisor-event-listener/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262172529,"owners_count":23270036,"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":["event-handler","supervisor"],"created_at":"2025-05-31T19:09:35.504Z","updated_at":"2026-03-08T09:37:16.232Z","avatar_url":"https://github.com/ouqiang.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# supervisor-event-listener\nSupervisor事件通知, 支持邮件, Slack, WebHook\n\n## 简介\nSupervisor是*nix环境下的进程管理工具, 可以把前台进程转换为守护进程, 当进程异常退出时自动重启.  \nsupervisor-event-listener监听进程异常退出事件, 并发送通知.\n  \n## 下载\n[v1.0](https://github.com/ouqiang/supervisor-event-listener/releases)\n\n### 源码安装\n* `go get -u github.com/ouqiang/supervisor-event-listener`\n\n## Supervisor配置\n```ini\n[eventlistener:supervisor-event-listener]\n; 默认读取配置文件/etc/supervisor-event-listener.ini\ncommand=/path/to/supervisor-event-listener\n; 指定配置文件路径\n;command=/path/to/supervisor-event-listener -c /path/to/supervisor-event-listener.ini\nevents=PROCESS_STATE_EXITED\n......\n```\n\n## 配置文件, 默认读取`/etc/supervisor-event-listener.ini`\n\n```ini \n[default]\n# 通知类型 mail,slack,webhook 只能选择一种\nnotify_type = mail\n\n# 邮件服务器配置\nmail.server.user = test@163.com\nmail.server.password = 123456\nmail.server.host = smtp.163.com\nmail.server.port = 25\n\n# 邮件收件人配置, 多个收件人, 逗号分隔\nmail.user = hello@163.com\n\n# Slack配置\nslack.webhook_url = https://hooks.slack.com/services/xxxx/xxx/xxxx\nslack.channel = exception\n\n# WebHook通知URL配置 \nwebhook_url = http://my.webhook.com\n\n```\n\n## 通知内容\n邮件、Slack\n```shell\nHost: ip(hostname)\nProcess: process-name\nPID: 6152\nEXITED FROM state: RUNNING\n```\nWebHook, Post请求, 字段含义查看Supervisor文档\n```json\n{\n  \"Header\": {\n    \"Ver\": \"3.0\",\n    \"Server\": \"supervisor\",\n    \"Serial\": 11,\n    \"Pool\": \"supervisor-listener\",\n    \"PoolSerial\": 11,\n    \"EventName\": \"PROCESS_STATE_EXITED\",\n    \"Len\": 84\n  },\n  \"Payload\": {\n    \"Ip\": \"ip(hostname)\",\n    \"ProcessName\": \"process-name\",\n    \"GroupName\": \"group-name\",\n    \"FromState\": \"RUNNING\",\n    \"Expected\": 0,\n    \"Pid\": 6371\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouqiang%2Fsupervisor-event-listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fouqiang%2Fsupervisor-event-listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouqiang%2Fsupervisor-event-listener/lists"}