1.1.0 • Published 4 years ago

pm2-notifier v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

PM2 Notifier

Supported Messaging Tools

  • DingTalk (钉钉)
  • Feishu (飞书)

Installation

pm2 install pm2-notifier

Usage

Config

OptionTypeRequiredDefault
eventsstring[]no['log:err', 'process:exception', 'process:event']
pollingnumberno10000 (ms)
max_polling_timenumberno60000 (ms)
dingtalkobjectno
- access_tokenstringyes
- secretstringyes
- at_mobilesstring[]no
- at_allbooleannofalse
- enablebooleannotrue
feishuobjectno
- access_tokenstringyes
- enablebooleannotrue

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 notification

Now, start your processes with pm2 start ecosystem.config.yml.

License

MIT

Copyright (c) 2020, Acathur