riemann-babbler 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.
@@ -68,5 +68,5 @@ end
68
68
 
69
69
  # start plugins
70
70
  Parallel.each( plugins, :in_threads => plugins.count ) do |plugin|
71
- require "#{plugin}"
71
+ require plugin
72
72
  end
data/config.yml CHANGED
@@ -3,7 +3,7 @@ riemann:
3
3
  port: 5555
4
4
 
5
5
  logger:
6
- level: DEBUG
6
+ level: 2
7
7
 
8
8
  plugins:
9
9
 
@@ -1,3 +1,6 @@
1
+ #encoding: utf-8
2
+
3
+ # Базовое описание плагина
1
4
  module Riemann
2
5
  module Babbler
3
6
 
@@ -8,7 +11,6 @@ module Riemann
8
11
  def run
9
12
  new.run
10
13
  end
11
-
12
14
  end
13
15
  end
14
16
 
@@ -36,6 +38,7 @@ module Riemann
36
38
  def host
37
39
  hostname = `hostname`.chomp.downcase
38
40
  hostname += options.riemann.suffix unless options.riemann.suffix.nil?
41
+ hostname = options.riemann.prefix + hostname unless options.riemann.prefix.nil?
39
42
  hostname
40
43
  end
41
44
 
@@ -69,7 +72,7 @@ module Riemann
69
72
  def plugin
70
73
  end
71
74
 
72
- # описание статуса
75
+ # хелпер, описание статуса
73
76
  def state(my_state)
74
77
  case
75
78
  when my_state.between?(plugin.states.warning, plugin.states.critical)
@@ -14,7 +14,7 @@ class Riemann::Babbler::Disk
14
14
  x = f[4].to_f/100
15
15
  disk.merge!({f[5] => x})
16
16
  end
17
- return disk
17
+ disk
18
18
  end
19
19
 
20
20
  def tick
@@ -8,7 +8,6 @@ class Riemann::Babbler::Memory
8
8
  def memory
9
9
  m = File.read('/proc/meminfo').split(/\n/).inject({}) { |info, line|
10
10
  x = line.split(/:?\s+/)
11
- # Assume kB...
12
11
  info[x[0]] = x[1].to_i
13
12
  info
14
13
  }
@@ -1,3 +1,3 @@
1
1
  module Babbler
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riemann-client
@@ -131,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  segments:
133
133
  - 0
134
- hash: 4155966889077265892
134
+ hash: 4407895469086512717
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  none: false
137
137
  requirements: