sensu-extensions-check-deps 0.0.6 → 0.0.7
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/lib/sensu/extensions/check-deps.rb +7 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f86f039cef0ecfefdc313e36228b510a611a9091
|
4
|
+
data.tar.gz: e66a9c32c45683ea45f70301550c44391213cb45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3eec73ba4370dd920cf0e3c717e326a1a5c23754750bcca8cca89009eb3599a94653e08eeba23e59c0dab4d36a4c4503d9f8104fc6bc2e844dee3bb94ec406e
|
7
|
+
data.tar.gz: fed3bf56ad6ba62a377bef89963227c434907e458f5e01f6f11ba52050aa75be4f7460d36e387cac8ad7383432daad29feaedb8b5835f85f133bb7536e495424
|
@@ -15,15 +15,13 @@ module Sensu
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Will post Slack message to channel sensu
|
18
|
-
def writeToSlack(message, err=false)
|
19
|
-
webhookUrl = "https://hooks.slack.com/services/
|
18
|
+
def writeToSlack(message, webhook, err=false)
|
19
|
+
webhookUrl = "https://hooks.slack.com/services/" + webhook
|
20
20
|
channel = "#sensu"
|
21
|
-
emoji = ":no_entry:"
|
22
21
|
begin
|
23
22
|
payload = {
|
24
23
|
:channel => channel,
|
25
24
|
:text => message,
|
26
|
-
:icon_url => emoji
|
27
25
|
}.to_json
|
28
26
|
cmd = "curl -X POST --data-urlencode 'payload=#{payload}' #{webhookUrl}"
|
29
27
|
system(cmd)
|
@@ -31,7 +29,6 @@ module Sensu
|
|
31
29
|
puts "failed to notify slack, proceeding..."
|
32
30
|
end
|
33
31
|
end
|
34
|
-
#writeToSlack("Event was blocked: " + @event['check']['name'] + "becasuse some of dependencies was already triggered. Deps list: "+ @event['check']['dependencies'])
|
35
32
|
|
36
33
|
# Make an HTTP GET request to the Sensu API, using the URI
|
37
34
|
# path provided. Uses Sensu settings to determine how to
|
@@ -114,11 +111,12 @@ module Sensu
|
|
114
111
|
begin
|
115
112
|
Timeout::timeout(10) do
|
116
113
|
if dependency_events_exist?(event)
|
117
|
-
writeToSlack("event exists for check dependency")
|
118
|
-
writeToSlack("Event: #{event[:check][:name]}
|
114
|
+
writeToSlack(":no_entry: event exists for check dependency")
|
115
|
+
writeToSlack(":no_entry: Event: #{event[:check][:name]} will be blocked Action: #{event[:action]}. Deps list: #{event[:check][:dependencies][:dependency]}")
|
119
116
|
["event exists for check dependency", 1]
|
120
|
-
|
121
|
-
writeToSlack("no current events for check dependencies")
|
117
|
+
else
|
118
|
+
writeToSlack(":arrow_up: no current events for check dependencies")
|
119
|
+
writeToSlack(":arrow_up: Event: #{event[:check][:name]} will pass. Action: #{event[:action]}. Deps list: #{event[:check][:dependencies][:dependency]}")
|
122
120
|
["no current events for check dependencies", 1]
|
123
121
|
end
|
124
122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-extensions-check-deps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Mevzos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-extension
|