This is a creation in Article, where the information may have evolved or changed.
Supervisor-event-listener
Supervisor Event notification, mail support, Slack, WebHook
Brief introduction
Supervisor is a process management tool in the *NIX environment that transforms the foreground process into a daemon and restarts automatically when the process exits unexpectedly.
The Supervisor-event-listener listens for a process exception exit event and sends a notification.
Project Address
Supervisor-event-listener
Supervisor Configuration
[eventlistener:supervisor-event-listener]; 默认读取配置文件/etc/supervisor-event-listener.inicommand=/path/to/supervisor-event-listener; 指定配置文件路径;command=/path/to/supervisor-event-listener -c /path/to/supervisor-event-listener.inievents=PROCESS_STATE_EXITED......
configuration file, default read/etc/supervisor-event-listener.ini
[default]# 通知类型 mail,slack,webhook 只能选择一种notify_type = mail# 邮件服务器配置mail.server.user = test@163.commail.server.password = 123456mail.server.host = smtp.163.commail.server.port = 25# 邮件收件人配置, 多个收件人, 逗号分隔mail.user = hello@163.com# Slack配置slack.webhook_url = https://hooks.slack.com/services/xxxx/xxx/xxxxslack.channel = exception# WebHook通知URL配置 webhook_url = http://my.webhook.com
Notification content
Mail, Slack
Host: ip(hostname)Process: process-namePID: 6152EXITED FROM state: RUNNING
WebHook, POST request, field meaning View supervisor document
{"Header": {"Ver": "3.0", "Server": "Supervisor", "Serial": One, "Pool": "Supervisor -listener "," poolserial ": One," EventName ":" process_state_exited "," Len ": +," Payload ": {" IP ":" IP "(hostn AME) "," ProcessName ":" Process-name "," GroupName ":" Group-name "," fromstate ":" RUNNING "," expected ": 0," Pi D ": 6371}}