alerty 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3aebfe7ba5184735ab0d413628384502ce41b3a1
4
- data.tar.gz: 47c6100062890783cd3c95cd2a1bb3ea9554396b
3
+ metadata.gz: ed50701fa9c60c4eeb6a23f0d95cac72949d1274
4
+ data.tar.gz: 98656e48c9a30c688340ce1c24b2293aff3893da
5
5
  SHA512:
6
- metadata.gz: 427b8bca35c0e644daf46e7dd23cbb0d0bb2d3430dd25aae3608bc1e0780817840d4716b77b04a2441441509631a74fa4c44fc9383204dac829e770394e860dc
7
- data.tar.gz: 05f4cf1c8cd05d20926d58943f06fa7464c1197679b41fb77710c8adfefe528ded0ea0762073c3d120e43cad282f2f5748a73ed97669cf90688672697233a48a
6
+ metadata.gz: 5d67e7c6ba8a66a28b2de8d464d3a429fb10b1b6694e0957b5adf4eb85841b977c369538d4a189dc852e42ac999b6500556cb1fc0c3a8687d4e8d399ce0b9d32
7
+ data.tar.gz: e3c3ba190183bfff89960a8b0391f163735334ec842afed46081f1932d49d770c838bd782f8b7d86e163eea9a8f043c4cf20a991bb02a77b3fbeda6015781a1e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.6 (2015/08/14)
2
+
3
+ Enhancements:
4
+
5
+ * Add info log to show command result
6
+
1
7
  # 0.0.5 (2015/08/14)
2
8
 
3
9
  Changes:
data/alerty.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "alerty"
3
- gem.version = '0.0.5'
3
+ gem.version = '0.0.6'
4
4
  gem.author = ['Naotoshi Seo']
5
5
  gem.email = ['sonots@gmail.com']
6
6
  gem.homepage = 'https://github.com/sonots/alerty'
@@ -1,5 +1,6 @@
1
1
  require 'frontkick'
2
2
  require 'socket'
3
+ require 'json'
3
4
 
4
5
  class Alerty
5
6
  class Command
@@ -12,17 +13,18 @@ class Alerty
12
13
  def run!
13
14
  started_at = Time.now
14
15
  result = Frontkick.exec("#{@command} 2>&1", @opts)
16
+ record = {
17
+ hostname: @hostname,
18
+ command: @command,
19
+ exitstatus: result.exitstatus,
20
+ output: result.stdout,
21
+ started_at: started_at.to_f,
22
+ duration: result.duration,
23
+ }
24
+ Alerty.logger.info { "result: #{record.to_json}" }
15
25
  if result.success?
16
26
  exit 0
17
27
  else
18
- record = {
19
- hostname: @hostname,
20
- command: @command,
21
- exitstatus: result.exitstatus,
22
- output: result.stdout,
23
- started_at: started_at.to_f,
24
- duration: result.duration,
25
- }
26
28
  Config.plugins.each do |plugin|
27
29
  begin
28
30
  plugin.alert(record)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alerty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo