riemann-tools 0.0.7 → 0.0.8
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/bin/riemann-health +1 -1
- data/bin/riemann-net +18 -5
- data/bin/riemann-riak +1 -1
- metadata +2 -2
data/bin/riemann-health
CHANGED
data/bin/riemann-net
CHANGED
@@ -7,10 +7,9 @@ require File.expand_path('../../lib/riemann/tools', __FILE__)
|
|
7
7
|
class Riemann::Tools::Net
|
8
8
|
include Riemann::Tools
|
9
9
|
|
10
|
-
opt :
|
11
|
-
opt :
|
12
|
-
|
13
|
-
|
10
|
+
opt :interfaces, "Interfaces to monitor", :type => :strings, :default => nil
|
11
|
+
opt :ignore_interfaces, "Interfaces to ignore", :type => :strings, :default =>['lo']
|
12
|
+
|
14
13
|
def initialize
|
15
14
|
@old_state = nil
|
16
15
|
end
|
@@ -20,6 +19,7 @@ class Riemann::Tools::Net
|
|
20
19
|
state = f.split("\n").inject({}) do |s, line|
|
21
20
|
if line =~ /\s*(\w+?):\s*([\s\d]+)\s*/
|
22
21
|
iface = $1
|
22
|
+
|
23
23
|
['rx bytes',
|
24
24
|
'rx packets',
|
25
25
|
'rx errs',
|
@@ -45,6 +45,19 @@ class Riemann::Tools::Net
|
|
45
45
|
|
46
46
|
s
|
47
47
|
end
|
48
|
+
|
49
|
+
# Filter interfaces
|
50
|
+
if is = opts[:interfaces]
|
51
|
+
state = state.select do |service, value|
|
52
|
+
is.include? service.split(' ').first
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
state = state.reject do |service, value|
|
57
|
+
opts[:ignore_interfaces].include? service.split(' ').first
|
58
|
+
end
|
59
|
+
|
60
|
+
state
|
48
61
|
end
|
49
62
|
|
50
63
|
def tick
|
@@ -72,7 +85,7 @@ class Riemann::Tools::Net
|
|
72
85
|
|
73
86
|
report(
|
74
87
|
:service => service,
|
75
|
-
:metric => (delta / opts[:interval]),
|
88
|
+
:metric => (delta.to_f / opts[:interval]),
|
76
89
|
:state => svc_state
|
77
90
|
)
|
78
91
|
end
|
data/bin/riemann-riak
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
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: 2012-04-
|
12
|
+
date: 2012-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riemann-client
|