1.1.0 • Published 5 years ago
pm2-notifier v1.1.0
PM2 Notifier
Supported Messaging Tools
- DingTalk (钉钉)
- Feishu (飞书)
Installation
pm2 install pm2-notifierUsage
Config
| Option | Type | Required | Default |
|---|---|---|---|
| events | string[] | no | ['log:err', 'process:exception', 'process:event'] |
| polling | number | no | 10000 (ms) |
| max_polling_time | number | no | 60000 (ms) |
| dingtalk | object | no | |
| - access_token | string | yes | |
| - secret | string | yes | |
| - at_mobiles | string[] | no | |
| - at_all | boolean | no | false |
| - enable | boolean | no | true |
| feishu | object | no | |
| - access_token | string | yes | |
| - enable | boolean | no | true |
Example
Add environment variables in your ecosystem file, here is an example write in yaml format.
apps:
- script: ./main.js
name: app
env_notifier:
events:
- log:err
- process:event
dingtalk:
access_token: # your dingtalk access token
secret: # your dingtalk secret
at_all: true
feishu:
access_token: # your feishu access token
enable: false # disable feishu notificationNow, start your processes with pm2 start ecosystem.config.yml.
License
Copyright (c) 2020, Acathur