riemann-babbler 0.7.8 → 0.7.9

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.
data/config.yml CHANGED
@@ -21,8 +21,8 @@ plugins:
21
21
  disk:
22
22
  service: disk
23
23
  states:
24
- warning: 0.7
25
- critical: 0.85
24
+ warning: 70
25
+ critical: 85
26
26
 
27
27
  cpu:
28
28
  service: cpu usage
@@ -33,8 +33,8 @@ plugins:
33
33
  memory:
34
34
  service: memory
35
35
  states:
36
- warning: 0.6
37
- critical: 0.8
36
+ warning: 70
37
+ critical: 85
38
38
 
39
39
  net:
40
40
  service: net
@@ -26,8 +26,8 @@ class Riemann::Babbler::Disk < Riemann::Babbler
26
26
  point_stat = Filesystem.stat point
27
27
  human_point = point == "/" ? "/root" : point
28
28
  human_point.gsub!(/^\//, "").gsub!(/\//, "_")
29
- disk << { :service => plugin.service + " #{human_point} % block", :metric => 1- point_stat.blocks_available.to_f/point_stat.blocks }
30
- disk << { :service => plugin.service + " #{human_point} % inode", :metric => 1 - point_stat.files_available.to_f/point_stat.files }
29
+ disk << { :service => plugin.service + " #{human_point} % block", :metric => (1- point_stat.blocks_available.to_f/point_stat.blocks).round(2) * 100 }
30
+ disk << { :service => plugin.service + " #{human_point} % inode", :metric => (1 - point_stat.files_available.to_f/point_stat.files).round(2) * 100 }
31
31
  disk << { :service => plugin.service + " #{human_point} abs free", :metric => point_stat.blocks_free * point_stat.block_size, :state => 'ok'}
32
32
  disk << { :service => plugin.service + " #{human_point} abs total", :metric => point_stat.blocks * point_stat.block_size, :state => 'ok'}
33
33
  end
@@ -19,8 +19,8 @@ class Riemann::Babbler::Memory < Riemann::Babbler
19
19
  desc = "usage\n\n#{shell('ps -eo pmem,pid,cmd | sort -nrb -k1 | head -10').chomp}"
20
20
 
21
21
  [
22
- { :service => plugin.service + " % free", :metric => fraction },
23
- { :service => plugin.service + " % swap", :metric => swap_fraction },
22
+ { :service => plugin.service + " % free", :metric => fraction.round(2) * 100 },
23
+ { :service => plugin.service + " % swap", :metric => swap_fraction.round(2) * 100 },
24
24
  { :service => plugin.service + " abs free", :metric => free, :state => 'ok', :description => desc },
25
25
  { :service => plugin.service + " abs total", :metric => total, :state => 'ok', :description => desc },
26
26
  { :service => plugin.service + " abs cached", :metric => cached, :state => 'ok', :description => desc },
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '0.7.8'
3
+ VERSION = '0.7.9'
4
4
  end
5
5
  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.7.8
4
+ version: 0.7.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
165
  version: '0'
166
166
  segments:
167
167
  - 0
168
- hash: -2012535303006927832
168
+ hash: -2176956737832810932
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements: