riemann-babbler 2.0.0pre1 → 2.0.0pre2
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ class Riemann::Babbler::Plugin::Net < Riemann::Babbler::Plugin
|
|
18
18
|
|
19
19
|
def init
|
20
20
|
plugin.set_default(:service, 'net')
|
21
|
+
plugin.set_default(:include_alias, false)
|
21
22
|
plugin.set_default(:filter, ['rx bytes', 'rx errs', 'rx drop', 'tx bytes', 'tx errs', 'tx drop'])
|
22
23
|
end
|
23
24
|
|
@@ -27,6 +28,7 @@ class Riemann::Babbler::Plugin::Net < Riemann::Babbler::Plugin
|
|
27
28
|
f.split("\n").each do |line|
|
28
29
|
iface = line.split(':')[0].strip
|
29
30
|
iface.gsub!(/\./, '_')
|
31
|
+
next if (iface =~ /\./ && !plugin.include_alias)
|
30
32
|
next unless line =~ /(\w*)\:\s*([\s\d]+)\s*/
|
31
33
|
WORDS.map do |service|
|
32
34
|
service
|
@@ -34,7 +36,7 @@ class Riemann::Babbler::Plugin::Net < Riemann::Babbler::Plugin
|
|
34
36
|
$2.split(/\s+/).map { |str| str.to_i }
|
35
37
|
).each do |service, value|
|
36
38
|
next unless plugin.filter.include? service
|
37
|
-
status << { :service => "#{plugin.service} #{
|
39
|
+
status << { :service => "#{plugin.service} #{iface} #{service}", :metric => value, :as_diff => true }
|
38
40
|
end
|
39
41
|
end
|
40
42
|
status
|