sensu-plugins-microsoft-teams 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/handler-microsoft-teams.rb +1 -21
- data/lib/sensu-plugins-microsoft-teams/version.rb +1 -1
- 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: cddaaf6d9c10924404d6d755fd56e4ccdb9dd62e
|
|
4
|
+
data.tar.gz: 3b6299665fd701fc0598048104b0a408c1445ac6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55eb85e5bbf0fdfa43d83f01bdff63a52587524e0ad1c9154712473e7f9108dfd6497989e920a0b0dd8afbde55d769481b00d9e21ea8974e8455455140d5094c
|
|
7
|
+
data.tar.gz: 783f10b7a6f3ac983468adc7f9feb2be9845a20944af9769f8dd208ce3c962b3bd956b2fcb305b515bc63f70209ec48df7186f1f2080c2c959608ab4f134036b
|
|
@@ -71,10 +71,6 @@ class MicrosoftTeams < Sensu::Handler
|
|
|
71
71
|
get_setting('template') || get_setting('message_template')
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
def fields
|
|
75
|
-
get_setting('fields')
|
|
76
|
-
end
|
|
77
|
-
|
|
78
74
|
def proxy_address
|
|
79
75
|
get_setting('proxy_address')
|
|
80
76
|
end
|
|
@@ -172,28 +168,12 @@ class MicrosoftTeams < Sensu::Handler
|
|
|
172
168
|
end
|
|
173
169
|
|
|
174
170
|
def payload(notice)
|
|
175
|
-
client_fields = []
|
|
176
|
-
|
|
177
|
-
unless fields.nil?
|
|
178
|
-
fields.each do |field|
|
|
179
|
-
# arbritary based on what I feel like
|
|
180
|
-
# -vjanelle
|
|
181
|
-
is_short = true unless @event['client'].key?(field) && @event['client'][field].length > 50
|
|
182
|
-
client_fields << {
|
|
183
|
-
title: field,
|
|
184
|
-
value: @event['client'][field],
|
|
185
|
-
short: is_short
|
|
186
|
-
}
|
|
187
|
-
end
|
|
188
|
-
end
|
|
189
|
-
|
|
190
171
|
{
|
|
191
172
|
themeColor: color,
|
|
192
173
|
text: "#{@event['client']['address']} - #{translate_status}",
|
|
193
174
|
sections: [{
|
|
194
175
|
activityImage: teams_icon_url ? teams_icon_url : 'https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png',
|
|
195
|
-
text: [teams_message_prefix, notice].compact.join(' ')
|
|
196
|
-
fields: client_fields
|
|
176
|
+
text: [teams_message_prefix, notice].compact.join(' ')
|
|
197
177
|
}],
|
|
198
178
|
potentialAction: [{
|
|
199
179
|
'@type': teams_action_type ? teams_action_type : "OpenUri",
|