alerte_rouge 0.0.4 → 0.0.5
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 +8 -8
- data/alerte_rouge.gemspec +1 -1
- data/lib/alerte_rouge.rb +4 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ODIwYjVhMWYyZWVjNDJlOTU1ZTllNjkyZGQwN2Q3OTczZjUxYTVlYQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MjgxNTViMWJhZWUwNWY0MjJjMTZjNzRmY2NjODUzM2JhNWE0ZTk5ZQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
M2QwOTc1YTRkZDkzNmJiNTU0NDIzYzkwOGMzZmNlZGNhMzNmZjk3ODEyOTQ0
|
|
10
|
+
YTkxNDA0OTM4ZjQxZWQzNGVhMjQxYzc5NjU3ODdjY2I1ZDRkZTM2OWYxMDUw
|
|
11
|
+
OWU1MDVjMzlmYmY2M2UwNWVkMmFlNTEzNDFjNjk0YTUxZTEzMzM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MGU3Mzc5MDExNGE3MGIxMTM1YjcyYjdkNjMwODZmYzgyNTE0OTdmMzMyZTdk
|
|
14
|
+
YTdiNjhjYzQ0YzBjZWU1ZjFlYTZhZDllMmJmMTNmMTIzNjM2MDI3MTdhZDk5
|
|
15
|
+
MTk3NjhhM2QxY2RiMjc3OTNlZTU5YzBjYjhlNjgyZjU5MDQ4ODI=
|
data/alerte_rouge.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'alerte_rouge'
|
|
3
|
-
s.version = '0.0.
|
|
3
|
+
s.version = '0.0.5'
|
|
4
4
|
s.date = '2014-02-11'
|
|
5
5
|
s.summary = "Alerte-rouge.fr | Progressive Admin Notification System"
|
|
6
6
|
s.description = "A simple Gem that allows you to report your monitoring events to www.alerte-rouge.fr"
|
data/lib/alerte_rouge.rb
CHANGED
|
@@ -6,6 +6,8 @@ class AlerteRouge
|
|
|
6
6
|
|
|
7
7
|
@server_url = 'http://www.alerte-rouge.fr/api/events'
|
|
8
8
|
|
|
9
|
+
@hostname = Socket.gethostname
|
|
10
|
+
|
|
9
11
|
def self.key=(key)
|
|
10
12
|
@key = key
|
|
11
13
|
end
|
|
@@ -13,14 +15,7 @@ class AlerteRouge
|
|
|
13
15
|
def self.pass=(pass)
|
|
14
16
|
@pass = pass
|
|
15
17
|
end
|
|
16
|
-
|
|
17
|
-
def get_hostname
|
|
18
|
-
begin
|
|
19
|
-
return Socket.gethostname
|
|
20
|
-
rescue
|
|
21
|
-
return nil
|
|
22
|
-
end
|
|
23
|
-
end
|
|
18
|
+
|
|
24
19
|
|
|
25
20
|
def self.report(uid, message, is_error = false)
|
|
26
21
|
begin
|
|
@@ -30,7 +25,7 @@ class AlerteRouge
|
|
|
30
25
|
uid: uid,
|
|
31
26
|
description: message,
|
|
32
27
|
is_error: is_error,
|
|
33
|
-
hostname:
|
|
28
|
+
hostname: @hostname} )
|
|
34
29
|
rescue Exception => e
|
|
35
30
|
puts "Following error happened #{e.message}\n\nBacktrace:\n#{e.backtrace.join('\n')}"
|
|
36
31
|
return false
|