67 lines
1.6 KiB
Bash
Executable File
67 lines
1.6 KiB
Bash
Executable File
alerts1='[
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sda1",
|
|
"instance": "example1"
|
|
},
|
|
"annotations": {
|
|
"info": "The disk sda1 is running full",
|
|
"summary": "please check the instance example1"
|
|
}
|
|
},
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sda2",
|
|
"instance": "example1"
|
|
},
|
|
"annotations": {
|
|
"info": "The disk sda2 is running full",
|
|
"summary": "please check the instance example1",
|
|
"runbook": "the following link http://test-url should be clickable"
|
|
}
|
|
},
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sda1",
|
|
"instance": "example2"
|
|
},
|
|
"annotations": {
|
|
"info": "The disk sda1 is running full",
|
|
"summary": "please check the instance example2"
|
|
}
|
|
},
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sdb2",
|
|
"instance": "example2"
|
|
},
|
|
"annotations": {
|
|
"info": "The disk sdb2 is running full",
|
|
"summary": "please check the instance example2"
|
|
}
|
|
},
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sda1",
|
|
"instance": "example3",
|
|
"severity": "critical"
|
|
}
|
|
},
|
|
{
|
|
"labels": {
|
|
"alertname": "DiskRunningFull",
|
|
"dev": "sda1",
|
|
"instance": "example3",
|
|
"severity": "warning"
|
|
}
|
|
}
|
|
]'
|
|
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
|