Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit a4e8805

Browse files
author
Roberto Scudeller
committed
add conditional to close or add a note to alert in OpsGenie and use Priority from Check.Annotations opsgenie_priority
1 parent 3798991 commit a4e8805

6 files changed

+618
-6
lines changed

event.resolved.json

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"entity": {
3+
"entity_class": "agent",
4+
"system": {
5+
"hostname": "webserver01",
6+
"os": "linux",
7+
"platform": "centos",
8+
"platform_family": "rhel",
9+
"platform_version": "7.4.1708",
10+
"network": {
11+
"interfaces": [
12+
{
13+
"name": "lo",
14+
"addresses": [
15+
"127.0.0.1/8",
16+
"::1/128"
17+
]
18+
},
19+
{
20+
"name": "enp0s3",
21+
"mac": "08:00:27:11:ad:d2",
22+
"addresses": [
23+
"10.0.2.15/24",
24+
"fe80::26a5:54ec:cf0d:9704/64"
25+
]
26+
},
27+
{
28+
"name": "enp0s8",
29+
"mac": "08:00:27:bc:be:60",
30+
"addresses": [
31+
"172.28.128.3/24",
32+
"fe80::a00:27ff:febc:be60/64"
33+
]
34+
}
35+
]
36+
},
37+
"arch": "amd64"
38+
},
39+
"subscriptions": [
40+
"testing",
41+
"entity:webserver01"
42+
],
43+
"last_seen": 1542667635,
44+
"deregister": false,
45+
"deregistration": {},
46+
"user": "agent",
47+
"redact": [
48+
"password",
49+
"passwd",
50+
"pass",
51+
"api_key",
52+
"api_token",
53+
"access_key",
54+
"secret_key",
55+
"private_key",
56+
"secret"
57+
],
58+
"metadata": {
59+
"name": "webserver01",
60+
"namespace": "default",
61+
"labels": null,
62+
"annotations": null
63+
}
64+
},
65+
"check": {
66+
"check_hooks": null,
67+
"duration": 1.803135228,
68+
"executed": 1522101015,
69+
"high_flap_threshold": 0,
70+
"history": [
71+
{
72+
"executed": 1522100315
73+
},
74+
{
75+
"executed": 1522100915
76+
}
77+
],
78+
"command": "http_check.sh http://localhost:80",
79+
"handlers": [
80+
"slack"
81+
],
82+
"high_flap_threshold": 0,
83+
"interval": 20,
84+
"low_flap_threshold": 0,
85+
"publish": true,
86+
"runtime_assets": [],
87+
"subscriptions": [
88+
"testing"
89+
],
90+
"proxy_entity_name": "",
91+
"check_hooks": null,
92+
"stdin": false,
93+
"ttl": 0,
94+
"timeout": 0,
95+
"duration": 0.010849143,
96+
"executed": 1542667666,
97+
"history": [
98+
{
99+
"status": 1,
100+
"executed": 1542667666
101+
}
102+
],
103+
"issued": 1542667666,
104+
"output": "example output",
105+
"state": "failing",
106+
"status": 0,
107+
"total_state_change": 0,
108+
"last_ok": 0,
109+
"occurrences": 1,
110+
"occurrences_watermark": 1,
111+
"output_metric_format": "",
112+
"output_metric_handlers": [],
113+
"env_vars": null,
114+
"metadata": {
115+
"name": "check-nginx",
116+
"namespace": "default",
117+
"labels": null,
118+
"annotations": null
119+
}
120+
}
121+
}
+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"entity": {
3+
"entity_class": "agent",
4+
"system": {
5+
"hostname": "webserver01",
6+
"os": "linux",
7+
"platform": "centos",
8+
"platform_family": "rhel",
9+
"platform_version": "7.4.1708",
10+
"network": {
11+
"interfaces": [
12+
{
13+
"name": "lo",
14+
"addresses": [
15+
"127.0.0.1/8",
16+
"::1/128"
17+
]
18+
},
19+
{
20+
"name": "enp0s3",
21+
"mac": "08:00:27:11:ad:d2",
22+
"addresses": [
23+
"10.0.2.15/24",
24+
"fe80::26a5:54ec:cf0d:9704/64"
25+
]
26+
},
27+
{
28+
"name": "enp0s8",
29+
"mac": "08:00:27:bc:be:60",
30+
"addresses": [
31+
"172.28.128.3/24",
32+
"fe80::a00:27ff:febc:be60/64"
33+
]
34+
}
35+
]
36+
},
37+
"arch": "amd64"
38+
},
39+
"subscriptions": [
40+
"testing",
41+
"entity:webserver01"
42+
],
43+
"last_seen": 1542667635,
44+
"deregister": false,
45+
"deregistration": {},
46+
"user": "agent",
47+
"redact": [
48+
"password",
49+
"passwd",
50+
"pass",
51+
"api_key",
52+
"api_token",
53+
"access_key",
54+
"secret_key",
55+
"private_key",
56+
"secret"
57+
],
58+
"metadata": {
59+
"name": "webserver01",
60+
"namespace": "default",
61+
"labels": null,
62+
"annotations": {
63+
"opsgenie_priority": "P2"
64+
}
65+
}
66+
},
67+
"check": {
68+
"check_hooks": null,
69+
"duration": 1.903135228,
70+
"executed": 1522100915,
71+
"high_flap_threshold": 0,
72+
"history": [
73+
{
74+
"executed": 1522100315
75+
},
76+
{
77+
"executed": 1522100915
78+
}
79+
],
80+
"command": "http_check.sh http://localhost:80",
81+
"handlers": [
82+
"slack"
83+
],
84+
"high_flap_threshold": 0,
85+
"interval": 20,
86+
"low_flap_threshold": 0,
87+
"publish": true,
88+
"runtime_assets": [],
89+
"subscriptions": [
90+
"testing"
91+
],
92+
"proxy_entity_name": "",
93+
"check_hooks": null,
94+
"stdin": false,
95+
"ttl": 0,
96+
"timeout": 0,
97+
"duration": 0.010849143,
98+
"executed": 1542667666,
99+
"history": [
100+
{
101+
"status": 1,
102+
"executed": 1542667666
103+
}
104+
],
105+
"issued": 1542667666,
106+
"output": "example output",
107+
"state": "failing",
108+
"status": 1,
109+
"total_state_change": 0,
110+
"last_ok": 0,
111+
"occurrences": 1,
112+
"occurrences_watermark": 1,
113+
"output_metric_format": "",
114+
"output_metric_handlers": [],
115+
"env_vars": null,
116+
"metadata": {
117+
"name": "check-nginx",
118+
"namespace": "default",
119+
"labels": null,
120+
"annotations": {
121+
"opsgenie_priority": "P1"
122+
}
123+
}
124+
}
125+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"entity": {
3+
"entity_class": "agent",
4+
"system": {
5+
"hostname": "webserver01",
6+
"os": "linux",
7+
"platform": "centos",
8+
"platform_family": "rhel",
9+
"platform_version": "7.4.1708",
10+
"network": {
11+
"interfaces": [
12+
{
13+
"name": "lo",
14+
"addresses": [
15+
"127.0.0.1/8",
16+
"::1/128"
17+
]
18+
},
19+
{
20+
"name": "enp0s3",
21+
"mac": "08:00:27:11:ad:d2",
22+
"addresses": [
23+
"10.0.2.15/24",
24+
"fe80::26a5:54ec:cf0d:9704/64"
25+
]
26+
},
27+
{
28+
"name": "enp0s8",
29+
"mac": "08:00:27:bc:be:60",
30+
"addresses": [
31+
"172.28.128.3/24",
32+
"fe80::a00:27ff:febc:be60/64"
33+
]
34+
}
35+
]
36+
},
37+
"arch": "amd64"
38+
},
39+
"subscriptions": [
40+
"testing",
41+
"entity:webserver01"
42+
],
43+
"last_seen": 1542667635,
44+
"deregister": false,
45+
"deregistration": {},
46+
"user": "agent",
47+
"redact": [
48+
"password",
49+
"passwd",
50+
"pass",
51+
"api_key",
52+
"api_token",
53+
"access_key",
54+
"secret_key",
55+
"private_key",
56+
"secret"
57+
],
58+
"metadata": {
59+
"name": "webserver01",
60+
"namespace": "default",
61+
"labels": null,
62+
"annotations": {
63+
"opsgenie_priority": "P2"
64+
}
65+
}
66+
},
67+
"check": {
68+
"check_hooks": null,
69+
"duration": 1.903135228,
70+
"executed": 1522100915,
71+
"high_flap_threshold": 0,
72+
"history": [
73+
{
74+
"executed": 1522100315
75+
},
76+
{
77+
"executed": 1522100915
78+
}
79+
],
80+
"command": "http_check.sh http://localhost:80",
81+
"handlers": [
82+
"slack"
83+
],
84+
"high_flap_threshold": 0,
85+
"interval": 20,
86+
"low_flap_threshold": 0,
87+
"publish": true,
88+
"runtime_assets": [],
89+
"subscriptions": [
90+
"testing"
91+
],
92+
"proxy_entity_name": "",
93+
"check_hooks": null,
94+
"stdin": false,
95+
"ttl": 0,
96+
"timeout": 0,
97+
"duration": 0.010849143,
98+
"executed": 1542667666,
99+
"history": [
100+
{
101+
"status": 1,
102+
"executed": 1542667666
103+
}
104+
],
105+
"issued": 1542667666,
106+
"output": "example output",
107+
"state": "failing",
108+
"status": 0,
109+
"total_state_change": 0,
110+
"last_ok": 0,
111+
"occurrences": 1,
112+
"occurrences_watermark": 1,
113+
"output_metric_format": "",
114+
"output_metric_handlers": [],
115+
"env_vars": null,
116+
"metadata": {
117+
"name": "check-nginx",
118+
"namespace": "default",
119+
"labels": null,
120+
"annotations": {
121+
"opsgenie_priority": "P1"
122+
}
123+
}
124+
}
125+
}

event_with_opsgenie_priority.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"namespace": "default",
6161
"labels": null,
6262
"annotations": {
63-
"opsgenie_priority": "P1"
63+
"opsgenie_priority": "P2"
6464
}
6565
}
6666
},

0 commit comments

Comments
 (0)