...

Text file src/github.com/prometheus/alertmanager/examples/ha/send_alerts.sh

Documentation: github.com/prometheus/alertmanager/examples/ha

     1#!/usr/bin/env bash
     2alerts1='[
     3  {
     4    "labels": {
     5       "alertname": "DiskRunningFull",
     6       "dev": "sda1",
     7       "instance": "example1"
     8     },
     9     "annotations": {
    10        "info": "The disk sda1 is running full",
    11        "summary": "please check the instance example1"
    12      }
    13  },
    14  {
    15    "labels": {
    16       "alertname": "DiskRunningFull",
    17       "dev": "sda2",
    18       "instance": "example1"
    19     },
    20     "annotations": {
    21        "info": "The disk sda2 is running full",
    22        "summary": "please check the instance example1",
    23        "runbook": "the following link http://test-url should be clickable"
    24      }
    25  },
    26  {
    27    "labels": {
    28       "alertname": "DiskRunningFull",
    29       "dev": "sda1",
    30       "instance": "example2"
    31     },
    32     "annotations": {
    33        "info": "The disk sda1 is running full",
    34        "summary": "please check the instance example2"
    35      }
    36  },
    37  {
    38    "labels": {
    39       "alertname": "DiskRunningFull",
    40       "dev": "sdb2",
    41       "instance": "example2"
    42     },
    43     "annotations": {
    44        "info": "The disk sdb2 is running full",
    45        "summary": "please check the instance example2"
    46      }
    47  },
    48  {
    49    "labels": {
    50       "alertname": "DiskRunningFull",
    51       "dev": "sda1",
    52       "instance": "example3",
    53       "severity": "critical"
    54     }
    55  },
    56  {
    57    "labels": {
    58       "alertname": "DiskRunningFull",
    59       "dev": "sda1",
    60       "instance": "example3",
    61       "severity": "warning"
    62     }
    63  }
    64]'
    65curl -XPOST -d"$alerts1" http://localhost:9093/api/v1/alerts
    66curl -XPOST -d"$alerts1" http://localhost:9094/api/v1/alerts
    67curl -XPOST -d"$alerts1" http://localhost:9095/api/v1/alerts

View as plain text