2020-03-11 09:16:53 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-06-03 07:12:18 +00:00
|
|
|
alerts1='[
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sda1",
|
|
|
|
"instance": "example1"
|
2017-05-30 19:04:49 +00:00
|
|
|
},
|
|
|
|
"annotations": {
|
|
|
|
"info": "The disk sda1 is running full",
|
|
|
|
"summary": "please check the instance example1"
|
|
|
|
}
|
2016-06-03 07:12:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sda2",
|
|
|
|
"instance": "example1"
|
2017-05-30 19:04:49 +00:00
|
|
|
},
|
|
|
|
"annotations": {
|
|
|
|
"info": "The disk sda2 is running full",
|
2017-08-13 17:48:36 +00:00
|
|
|
"summary": "please check the instance example1",
|
|
|
|
"runbook": "the following link http://test-url should be clickable"
|
2017-05-30 19:04:49 +00:00
|
|
|
}
|
2016-06-03 07:12:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sda1",
|
|
|
|
"instance": "example2"
|
2017-05-30 19:04:49 +00:00
|
|
|
},
|
|
|
|
"annotations": {
|
|
|
|
"info": "The disk sda1 is running full",
|
|
|
|
"summary": "please check the instance example2"
|
|
|
|
}
|
2016-06-03 07:12:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sdb2",
|
|
|
|
"instance": "example2"
|
2017-05-30 19:04:49 +00:00
|
|
|
},
|
|
|
|
"annotations": {
|
|
|
|
"info": "The disk sdb2 is running full",
|
|
|
|
"summary": "please check the instance example2"
|
|
|
|
}
|
2016-06-03 07:12:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sda1",
|
2017-06-01 08:43:44 +00:00
|
|
|
"instance": "example3",
|
|
|
|
"severity": "critical"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"labels": {
|
|
|
|
"alertname": "DiskRunningFull",
|
|
|
|
"dev": "sda1",
|
|
|
|
"instance": "example3",
|
|
|
|
"severity": "warning"
|
2016-06-03 07:12:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]'
|
|
|
|
curl -XPOST -d"$alerts1" http://localhost:9093/api/v1/alerts
|
|
|
|
curl -XPOST -d"$alerts1" http://localhost:9094/api/v1/alerts
|
|
|
|
curl -XPOST -d"$alerts1" http://localhost:9095/api/v1/alerts
|