Docs
  • StakePool
  • Avail
    • RPC
    • Faucet
    • Live Peers
    • Snapshots
      • Avail
  • Namada
    • RPC
    • Live Peers
    • Snapshots
      • Namada
  • Polygon
    • Binaries
      • Run a Node
      • Monitoring Grafana
      • Alert Message Api
      • Monitoring Blocks Heimdall and Bor
      • Monitoring logs
    • Kubernetes
      • Technical documentation
      • control pane cluster
      • worker cluster
      • Run a node
      • Files
      • Access the Kubernetes Dashboard
      • Access the Kubernetes Dashboard Grafana
      • Monitoring logs
    • Erigon
      • Run a Node
    • Snapshots
      • Polygon
    • Scripts
      • Block Hash
      • Bor Status
      • Checkpoint Notifier
      • Checkpoint with prometheus
      • Manage Bor
      • Peer Delivering
      • Polygon Validator Participation Analyzer
      • Rpc Update
      • Span Participation
    • RPC
    • Faucet
    • Live Peers
Powered by GitBook
On this page
  • Discord and Slack custom messages with Message API
  • 1 - Clone repository
  • 2 - Enter the project directory
  • 3 - Install dependencies
  • 4 - Create and configure config.json file in root directory of aplication
  • 5 - Running the server.js file with PM2
  • 2 - Restart alertmanager
  1. Polygon
  2. Binaries

Alert Message Api

Discord and Slack custom messages with Message API

Software install

1 - Clone repository

git clone git@github.com:Michel-Leidson/alert-message-api.git

2 - Enter the project directory

cd alert-message-api

3 - Install dependencies

npm install

4 - Create and configure config.json file in root directory of aplication

nano config.json

{
    "slack": {
        "url":"<YOUR SLACK URL WEBHOOK HERE>"
    },
    "discord":{
        "url":"<YOUR DISCORD URL WEBHOOK HERE>"
    },
    "grafana":{
        "url":"YOUR GRAFANA URL HERE"
    },
    "alertmanager": {
        "url":"YOUR ALERTMANAGER URL HERE"
    }
}

5 - Running the server.js file with PM2

pm2 start server.js

Configuring external Alertmanager in Grafana

1 - Select Alert Admin menu in Grafana

2 - Click in "Add Alertmanager"

3 - Type URL alermanager and click in "Add Alertmanagers" button

Configuring webhook routes in alertmanager config file

1 - Configuring alertmanager config file

sudo nano /usr/local/alertmanager/alertmanager.yml

route:
    
  group_by: ['alertname']
  group_wait: 30s
  group_interval: 1m
  repeat_interval: 12h
  receiver: "apialert"

  routes:

    - receiver: "apialert"
      group_wait: 30s
      group_interval: 1m
      repeat_interval: 12h
      continue: true

    - receiver: "apialertslack"
      group_wait: 30s
      group_interval: 1m
      repeat_interval: 12h
      continue: true


receivers:

  - name: "apialert"
    webhook_configs:
    - url: "http://127.0.0.1:5002/discord"

  - name: "apialertslack"
    webhook_configs:
    - url: "http://127.0.0.1:5002/slack"

2 - Restart alertmanager

sudo systemctl restart alertmanager
PreviousMonitoring GrafanaNextMonitoring Blocks Heimdall and Bor

Last updated 7 months ago