alerte_rouge 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmZmZjdhNTViMTgwNzc3ODRiM2NjMjMxMGEyZTM1MTBiZThiMTJkMg==
4
+ NzNhNThiM2FkZjQ3NzUyMDg3OGFkYjRmM2ZkYjI1NGZlNThlNTljZg==
5
5
  data.tar.gz: !binary |-
6
- NzRmYjIxMTJjNDdlYTY3NjQwZDQwODY2ZjRhZTBlYjRlMWU5YTU0Nw==
6
+ ODQ5ODIyNWNkZDM3MDQ2ZWJjOGFiMDkyOTc3ZmI0Y2RhNzE2MDY2Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTQxMjI4N2Q0YmE2MmJkYWY5NzhlMTIwMjMyOTVjY2EwYmI1ZDg0NTUxM2Fk
10
- NGM3Yzc4OWQ3OTdiMDk3NTg5M2U2NDIwYjhmYTNiNGViM2ViNTUxYjM0MGQz
11
- ZGRlMzIzOWI4ZGI4MTlmYTczODRmM2RlNWE2NTRiZTk0MTdiMDQ=
9
+ MjYwZGNjNzU1M2NlMmVmNDAyMWJiZmIzNjg4ODgwYTRjZGY1NjI4NzY4ZDdi
10
+ MWM4YzhjODgwNzE1NWZhYzg4OWYxODcyYmVhZjIxYzllYjY0YTFiYTkwOGU4
11
+ ZDFjYzg4ZDE5ZmEwZDgwNjE1NmJjOTE3NWYxNDY3ZjMwZGRkZjQ=
12
12
  data.tar.gz: !binary |-
13
- Y2QwYmRlOWMzYmVkYWNjNzIyYjQxODIwZmExNTE0MWZmZmJjZDcwNzQ5ZDA0
14
- NjdmNGQ2OTAzZTdjNmNkZGY4ZDU5NDJhYjA5NmRiNmE0YzZmZjAwNDg1ODc0
15
- ZDE3ZTNjYzkxOThhNGMzNTk5OWQxZDkwMDgxMTBjNTAxOWJmNWU=
13
+ MzcxNTE3YmU1N2E2N2U4ODM5OWRlZTVlMTA1ZjFkODE4NDYzMzU2NjliMGQ5
14
+ N2I1NjIwZTVkMmM4ZTg0ZTBhY2E0NGY5NDA4ODY5ZTYwZWNjYjk4YWIxMzhk
15
+ NmNiYjZjNGIwMTM1MWE1M2E3MWFkOTYyMjAyNzNiNDljNDVjNWI=
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Alerte Rouge
2
+
3
+ AlerteRouge is a **Progressive admin notification System**, which allows you to collect events accross multiple processes and mitigate them all in once place.
4
+
5
+ You'll also be able to create complex workflows and make sure that someone get's called everytime you asked for!
6
+
7
+ Goto: http://www.alerte-rouge.fr
8
+
9
+
10
+ # Installation
11
+
12
+ gem install alerte_rouge
13
+
14
+ # Usage
15
+ ### Create a Token
16
+ Authentication and Notifications workflows are based per Token. Therefore you need to first create a token before doing anything else.
17
+
18
+ Creating one Token for each monitored process is always a good idea. It will help design a workflow specifically for each process.
19
+
20
+ ### Setup your Script or App to use your token
21
+
22
+ Rails: create the following file **/config/initializers/alerte_rouge.rb**
23
+
24
+ require 'alerte_rouge'
25
+ AlerteRouge.key = ENV['your-key']
26
+ AlerteRouge.pass = ENV['your-pass']
27
+
28
+ ### Deliver an Error Notification
29
+
30
+ AlerteRouge.report('your_unique_key_for_whatever_you_monitor', "Any useful human readable message", true)
31
+
32
+ ### Deliver an OK Notification
33
+
34
+ AlerteRouge.report('your_unique_key_for_whatever_you_monitor', "Any useful human readable message", false)
35
+
36
+ ### Configure Alerte-rouge
37
+
38
+ Configure your workflow according to your needs.
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.2'
3
+ s.version = '0.0.4'
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
@@ -14,17 +14,27 @@ class AlerteRouge
14
14
  @pass = pass
15
15
  end
16
16
 
17
+ def get_hostname
18
+ begin
19
+ return Socket.gethostname
20
+ rescue
21
+ return nil
22
+ end
23
+ end
24
+
17
25
  def self.report(uid, message, is_error = false)
18
- raise Exception.new("You need to provide a key and a pass") if @key.nil? || @pass.nil?
19
-
20
- r = HTTParty.post(@server_url,
21
- :body => {p: @pass,
22
- k: @key,
23
- uid: uid,
24
- description: message,
25
- is_error: is_error} )
26
+ begin
27
+ r = HTTParty.post(@server_url,
28
+ :body => {p: @pass,
29
+ k: @key,
30
+ uid: uid,
31
+ description: message,
32
+ is_error: is_error,
33
+ hostname: get_hostname} )
34
+ rescue Exception => e
35
+ puts "Following error happened #{e.message}\n\nBacktrace:\n#{e.backtrace.join('\n')}"
36
+ return false
37
+ end
38
+ return true
26
39
  end
27
- end
28
-
29
- #pass '21l4jsdjas0f9sfaLKDLF2299121231=sdafa-asdf'
30
- #key '2131241kl4j1l2k0--0sadf-2-211!!jlj141241'
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alerte_rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - philib_j
@@ -30,6 +30,7 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - README.md
33
34
  - alerte_rouge.gemspec
34
35
  - lib/alerte_rouge.rb
35
36
  - nota.rb