0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-02-23 21:27:57 +00:00
alerta_alerta/contrib/examples/create-new-alert.sh

112 lines
2.3 KiB
Bash
Raw Normal View History

2014-03-29 23:31:29 +00:00
#!/bin/sh
2012-04-03 16:47:32 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2013-03-17 22:53:08 +00:00
{
2013-03-18 14:56:02 +00:00
"resource": "host678:eth0",
"event": "HW:NIC:FAILED",
"group": "Hardware",
2013-03-17 22:53:08 +00:00
"severity": "major",
2014-03-29 23:31:29 +00:00
"environment": "production",
2013-03-18 23:21:40 +00:00
"service": [
2014-03-29 23:31:29 +00:00
"Network"
2013-03-18 23:21:40 +00:00
],
2013-03-18 14:56:02 +00:00
"text": "Network interface eth0 is down.",
"value": "error"
2013-03-17 22:53:08 +00:00
}'
2013-03-18 23:21:40 +00:00
echo
2013-03-17 22:53:08 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2014-03-29 23:48:07 +00:00
{
2013-03-18 21:03:48 +00:00
"resource": "fw010",
"event": "NodeDown",
"group": "Firewall",
"value": "Down",
2013-03-17 22:53:08 +00:00
"severity": "major",
2014-05-16 21:32:42 +00:00
"environment": "development",
2012-10-03 21:56:38 +00:00
"service": [
2013-03-18 21:03:48 +00:00
"Network"
2012-10-03 21:56:38 +00:00
],
"tags": [
"location=London",
2013-03-17 22:53:08 +00:00
"region=EU"
],
2013-03-18 21:03:48 +00:00
"text": "Firewall is not responding to ping."
}'
2013-03-18 23:21:40 +00:00
echo
2013-03-18 14:56:02 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2014-03-29 23:48:07 +00:00
{
2013-03-18 14:56:02 +00:00
"resource": "router0011",
"event": "node_up",
"group": "Network",
"value": "UP",
"severity": "normal",
2014-03-29 23:31:29 +00:00
"environment": "infrastructure",
2013-03-18 14:56:02 +00:00
"service": [
2014-03-29 23:31:29 +00:00
"Shared"
2013-03-18 14:56:02 +00:00
],
"tags": [
"location=London",
"region=EU"
],
"text": "Router is up."
}'
2013-03-18 23:21:40 +00:00
echo
2013-03-18 14:56:02 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2014-03-29 23:48:07 +00:00
{
2013-03-18 14:56:02 +00:00
"resource": "mydb",
"event": "OraError",
2014-03-29 23:31:29 +00:00
"group": "Oracle",
2013-03-18 14:56:02 +00:00
"value": "ERROR 011",
"severity": "warning",
2014-03-29 23:31:29 +00:00
"environment": "development",
2013-03-18 14:56:02 +00:00
"service": [
2014-03-29 23:31:29 +00:00
"Database"
2013-03-18 14:56:02 +00:00
],
"tags": [
"location=London",
"region=EU"
],
"text": "Oracle 011 error."
}'
2013-03-18 23:21:40 +00:00
echo
2013-03-18 14:56:02 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2014-03-29 23:48:07 +00:00
{
2013-03-18 14:56:02 +00:00
"resource": "myapp",
"event": "SlowResponse",
"group": "Application",
"value": "5005ms",
"severity": "critical",
2014-03-29 23:31:29 +00:00
"environment": "development",
2013-03-18 14:56:02 +00:00
"service": [
"Web"
],
"tags": [
"location=London",
"region=EU"
],
"text": "Service unavailable."
}'
2013-03-18 23:21:40 +00:00
echo
2013-03-18 14:56:02 +00:00
2014-03-30 15:26:04 +00:00
curl -s -XPOST -H "Content-type: application/json" 'http://localhost:8080/api/alert' -d '
2014-03-29 23:48:07 +00:00
{
2013-03-18 14:56:02 +00:00
"resource": "host44",
"event": "SwapUtil",
"group": "OS",
"value": "94%",
"severity": "minor",
2014-03-29 23:31:29 +00:00
"environment": "production",
2013-03-18 14:56:02 +00:00
"service": [
"Platform"
],
"tags": [
"location=London",
"region=EU"
],
"text": "Swap utilisation is high."
}'
echo