fluent-plugin-cloudstack 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/README.textile +1 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/in_cloudstack.rb +13 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf8c72f2b2dce64fffca3ea87e2e3c40b2942b4
|
4
|
+
data.tar.gz: 198d9133f7389afb39060f3370f2157a4b4d425d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13de40b9ae392b6b400c7ff9f116b74d0676da594dc2109f1ca91d5f1e18fbcdefbb5ea3800f564de4e587079d1ec2c5cd21f30df0d7f901ec346af616e467f2
|
7
|
+
data.tar.gz: d8304d8fa925297b9ce7dbac4f8342f97a2b1ffd9415d9294528152d658461f0afb141182ef6c6f11a0adc1a46cf2abd89e1c59a1f2f4d6a3ad496c3c5588c9c
|
data/README.textile
CHANGED
@@ -53,6 +53,7 @@ h2. Configuration
|
|
53
53
|
ssl $cloudtack_api_ssl # true or false, default true
|
54
54
|
domain_id $cloudstack_domain_id
|
55
55
|
tag $fluentd_tag # default cloudstack
|
56
|
+
log_dir $fluentd_log_dir # default /var/log/td_agent
|
56
57
|
|
57
58
|
# debug mode
|
58
59
|
debug_mode $boolean # default false
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -2,6 +2,11 @@ module Fluent
|
|
2
2
|
class CloudStackInput < Input
|
3
3
|
Fluent::Plugin.register_input("cloudstack", self)
|
4
4
|
|
5
|
+
# To support log_level option implemented by Fluentd v0.10.43
|
6
|
+
unless method_defined?(:log)
|
7
|
+
define_method("log") { $log }
|
8
|
+
end
|
9
|
+
|
5
10
|
INTERVAL_MIN = 300
|
6
11
|
|
7
12
|
config_param :host
|
@@ -15,6 +20,7 @@ module Fluent
|
|
15
20
|
config_param :tag, :default => "cloudstack"
|
16
21
|
config_param :ssl, :default => true
|
17
22
|
config_param :debug_mode, :default => false
|
23
|
+
config_param :log_dir, :default => '/var/log/td_agent'
|
18
24
|
config_param :interval, :default => INTERVAL_MIN
|
19
25
|
|
20
26
|
attr_writer :before_events
|
@@ -42,7 +48,7 @@ module Fluent
|
|
42
48
|
end
|
43
49
|
end
|
44
50
|
|
45
|
-
@before_events_filepath = "
|
51
|
+
@before_events_filepath = "#{@log_dir}/before_events.#{tag}.yml"
|
46
52
|
|
47
53
|
if File.exist?(@before_events_filepath)
|
48
54
|
@before_events = YAML.load_file(@before_events_filepath)
|
@@ -50,7 +56,7 @@ module Fluent
|
|
50
56
|
@before_events = nil
|
51
57
|
end
|
52
58
|
|
53
|
-
@before_usages_filepath = "
|
59
|
+
@before_usages_filepath = "#{@log_dir}/before_usages.#{tag}.yml"
|
54
60
|
if File.exist?(@before_usages_filepath)
|
55
61
|
@before_usages = YAML.load_file(@before_usages_filepath)
|
56
62
|
else
|
@@ -66,7 +72,7 @@ module Fluent
|
|
66
72
|
super
|
67
73
|
run_reactor_thread
|
68
74
|
@thread = Thread.new(&method(:run))
|
69
|
-
|
75
|
+
log.info "listening cloudstack api on #{@host}"
|
70
76
|
end
|
71
77
|
|
72
78
|
def shutdown
|
@@ -82,8 +88,8 @@ module Fluent
|
|
82
88
|
emit_new_events
|
83
89
|
emit_usages
|
84
90
|
rescue => ex
|
85
|
-
|
86
|
-
|
91
|
+
log.warn("EM.periodic_timer loop error.")
|
92
|
+
log.warn("#{ex}, tracelog : \n#{ex.backtrace.join("\n")}")
|
87
93
|
end
|
88
94
|
end
|
89
95
|
end
|
@@ -212,8 +218,8 @@ module Fluent
|
|
212
218
|
def init_eventmachine
|
213
219
|
EM.epoll; EM.kqueue
|
214
220
|
EM.error_handler do |ex|
|
215
|
-
|
216
|
-
|
221
|
+
log.fatal("Eventmachine problem")
|
222
|
+
log.fatal("#{ex}, tracelog : \n#{ex.backtrace.join("\n")}")
|
217
223
|
end
|
218
224
|
end
|
219
225
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cloudstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuichi UEMURA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.0.3
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Fluentd input plugin to get usages and events from CloudStack API
|