notifu 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notifu/actors/slack.rb +37 -7
- data/lib/notifu/workers/actor.rb +1 -1
- data/lib/notifu.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f92de92fa8ed5338a3a54546f11e62cf02982df2
|
4
|
+
data.tar.gz: a70a4ba335761cf875d6612f8cbdd7779026aee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a253fc18bdfdffc429cf0bdcc754b7fc62f2d772f63836b13c7246bf7a1f2de7adf55fcb0b18cf2ef21d48c89f0a59036db101d2bebdd69c57e777b0009932ac
|
7
|
+
data.tar.gz: 0145b469d863bed91589af43da48b5c7af7b472685e60455065eed0c20c144381574bb01ddb8c5e9d9d8e0f41f589507d7882574c9888ac515e3a40eb41fac86
|
data/lib/notifu/actors/slack.rb
CHANGED
@@ -15,22 +15,52 @@ module Notifu
|
|
15
15
|
|
16
16
|
def post_data
|
17
17
|
{
|
18
|
-
text: self.text,
|
19
18
|
username: "notifu",
|
20
|
-
icon_emoji:
|
19
|
+
icon_emoji: ":loudspeaker:",
|
20
|
+
attachments: [
|
21
|
+
{
|
22
|
+
fallback: self.text,
|
23
|
+
color: self.color,
|
24
|
+
title: "#{self.issue.host} - #{self.issue.service}",
|
25
|
+
title_link: "https://sensu.skypicker.com/#/client/#{Notifu::CONFIG[:actors][:slack][:dc]}/#{self.issue.host}?check=#{self.issue.service}",
|
26
|
+
text: self.issue.message,
|
27
|
+
fields: [
|
28
|
+
{
|
29
|
+
title: "duration",
|
30
|
+
value: (Time.now.to_i - self.issue.time_created.to_i).duration,
|
31
|
+
short: true
|
32
|
+
},
|
33
|
+
{
|
34
|
+
title: "started",
|
35
|
+
value: Time.at(self.issue.time_created.to_i),
|
36
|
+
short: true
|
37
|
+
},
|
38
|
+
{
|
39
|
+
title: "occurrences/trigger",
|
40
|
+
value: "#{self.issue.occurrences_count}/#{self.issue.occurrences_trigger}",
|
41
|
+
short: true
|
42
|
+
},
|
43
|
+
{
|
44
|
+
title: "notifu ID",
|
45
|
+
value: self.issue.notifu_id,
|
46
|
+
short: true
|
47
|
+
}
|
48
|
+
]
|
49
|
+
}
|
50
|
+
]
|
21
51
|
}.to_json
|
22
52
|
end
|
23
53
|
|
24
|
-
def
|
54
|
+
def color
|
25
55
|
case self.issue.code
|
26
56
|
when 0
|
27
|
-
"
|
57
|
+
"good"
|
28
58
|
when 1
|
29
|
-
"
|
59
|
+
"warning"
|
30
60
|
when 2
|
31
|
-
"
|
61
|
+
"danger"
|
32
62
|
else
|
33
|
-
"
|
63
|
+
"#999999"
|
34
64
|
end
|
35
65
|
end
|
36
66
|
|
data/lib/notifu/workers/actor.rb
CHANGED
data/lib/notifu.rb
CHANGED