fluent-plugin-munin-node 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/in_munin_node.rb +5 -6
- data/lib/fluent_plugin_munin_node/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cc85cebb9aa3ff84454f7091991da8e1670a5c9
|
4
|
+
data.tar.gz: 219fcc96cab1061c30253b5cc4a867f1a48d8426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ececd21421a0e36dd8290b223a23c51f47a16114c399bebe5195d1008b322fe09425149c05e5dfda4140b1d4d91a36411fc9aff296d158680edecabbbd1355b
|
7
|
+
data.tar.gz: 8bbbf9a9275a397bae6e3034606fe4989a4352de4193e296615d0ec1ed9940c44f9b78d69b5f5ce5a61e407617d443ef0c002d05ddd431b2557cf25878f77506
|
@@ -33,7 +33,6 @@ class Fluent::MuninNodeInput < Fluent::Input
|
|
33
33
|
def start
|
34
34
|
super
|
35
35
|
|
36
|
-
@node = Munin::Node.new(@node_host, @node_port)
|
37
36
|
@loop = Coolio::Loop.new
|
38
37
|
timer = TimerWatcher.new(@interval, true, log, &method(:fetch_items))
|
39
38
|
@loop.attach(timer)
|
@@ -46,9 +45,6 @@ class Fluent::MuninNodeInput < Fluent::Input
|
|
46
45
|
|
47
46
|
# XXX: Comment out for exit soon. Is it OK?
|
48
47
|
#@thread.join
|
49
|
-
|
50
|
-
@node.disconnect
|
51
|
-
@node.connection.close
|
52
48
|
end
|
53
49
|
|
54
50
|
private
|
@@ -63,9 +59,12 @@ class Fluent::MuninNodeInput < Fluent::Input
|
|
63
59
|
def fetch_items
|
64
60
|
values_by_plugin = {}
|
65
61
|
|
66
|
-
|
62
|
+
# It's connected every fetch of metrics.
|
63
|
+
node = Munin::Node.new(@node_host, @node_port)
|
64
|
+
|
65
|
+
node.list.each do |plugin|
|
67
66
|
begin
|
68
|
-
plugin_values =
|
67
|
+
plugin_values = node.fetch(plugin)
|
69
68
|
values_by_plugin.update(plugin_values)
|
70
69
|
rescue => e
|
71
70
|
log.warn("#{plugin}: #{e.message}")
|