This Uptime plugin notifies all configured events (up, down, paused, restarted) by sending a HTTPS POST request to a slack.com URL.
Based on mintbridge/uptime-webhooks plugin.
To use this plugin, first install it using npm while in the Uptime directory:
$ npm install uptime-slack
Then to enable it, add it to the plugins/index.js
, as follows:
// in plugins/index.js
exports.init = function() {
require('uptime-slack').init();
}
Customize the plugin settings in the config/production.yaml
configuration file, as in the example below:
webhooks:
event:
up:
- 'https://xxxx.slack.com/services/hooks/incoming-webhook?token=xxxxxx'
down:
- 'https://xxxx.slack.com/services/hooks/incoming-webhook?token=xxxxxx'
paused:
- 'https://xxxx.slack.com/services/hooks/incoming-webhook?token=xxxxxx'
restarted:
- 'https://xxxx.slack.com/services/hooks/incoming-webhook?token=xxxxxx'
dashboardUrl: 'http://uptime.example.com'
channel: '#slack-channel'
username: 'uptime'
icon_emoji: ':fire:'