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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1812fc6dbf0444ed174e95b0196efa4cd2ad1d28
4
- data.tar.gz: be664f8dfe00eedbb1c6cbe59153e0852338d781
3
+ metadata.gz: ccf8c72f2b2dce64fffca3ea87e2e3c40b2942b4
4
+ data.tar.gz: 198d9133f7389afb39060f3370f2157a4b4d425d
5
5
  SHA512:
6
- metadata.gz: 9b502e1ecaf5a67d2317f3003bbcad7a7f9bcac56d13239e5046a7822c285688fc4e1214987b7a2638606157010994c3fdc58b7bd43692c4c2fdee169e3a655b
7
- data.tar.gz: c2c6be6088f7d65b837011b73e9f985848f3dbe32e5ea8c18143325af4e04be18698ba365cedcdf4348685e8fd48a0832c1b4c7734313f9a9065754543a5a4e7
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.0
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 = "logs/before_events.#{tag}.yml"
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 = "logs/before_usages.#{tag}.yml"
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
- $log.info "listening cloudstack api on #{@host}"
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
- $log.warn("EM.periodic_timer loop error.")
86
- $log.warn("#{ex}, tracelog : \n#{ex.backtrace.join("\n")}")
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
- $log.fatal("Eventmachine problem")
216
- $log.fatal("#{ex}, tracelog : \n#{ex.backtrace.join("\n")}")
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.0
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: 2013-11-06 00:00:00.000000000 Z
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.1.10
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