logstash-input-remote_proc 0.1.9 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fca24e5d1158779effdece8b7c0cafcf52f7150
4
- data.tar.gz: 6c7ca10796ad5786a6c7c53407775dae0b06754f
3
+ metadata.gz: 0e2da5e02a3c77fb94ec66fe6061a5f60ae3aee8
4
+ data.tar.gz: 1cd01b1862e72d11b0184818b7034eec7e668ef1
5
5
  SHA512:
6
- metadata.gz: 98e493503bbbf1a5fefc5cc42cc792f0db95f8a18c20e4cf0c77755481a2a0150871908ef692be2685a4775073709999f327a1d5b8b7de59bf1bb37e0f523c97
7
- data.tar.gz: 2816b99edcc52e08a151197ef2f5c81dabf7ae1f5b8bc588e44554392a6597176d390954e54d57919ee947057d90e12acd70051833c22cf081052cdf40712a62
6
+ metadata.gz: df842d3954bedee147addb1827a6581a16ab861b356cc9dab96e044617cfd1e163bbbebee4fbe72288c88b24d4b2771cb8f954ba39a27007fa9768af3b9ccf91
7
+ data.tar.gz: fc802e386c47601fb8eb3476a36f82222cf313320d51620e936d36acff2fe37bb29dfdad5c5f10f59ebb81e920f34368d2f5bc7372f29cb322a79360ed6a72c0
@@ -49,6 +49,21 @@ module LogStash
49
49
  # proc_list => ["_all"]
50
50
  # }
51
51
  # }
52
+ #
53
+ # -------------------------------------------------------------------------
54
+ # Example with specific procfs prefix path and system reader for certain host.
55
+ # By default the system reader is 'cat' and the procfs prefix path is '/proc'.
56
+ # [source,ruby]
57
+ # -------------------------------------------------------------------------
58
+ # input {
59
+ # remote_proc {
60
+ # servers => [
61
+ # { host => "remote.server.com" username => "medium" system_reader => "dd bs=1 2>/dev/null" proc_prefix_path => "if=/proc"},
62
+ # { host => "h2.net" username => "poc" gateway_host => "h.gw.net" gateway_username => "user" }
63
+ # ]
64
+ # proc_list => ["stat", "meminfo"]
65
+ # }
66
+ # }
52
67
  # -------------------------------------------------------------------------
53
68
  #
54
69
  class RemoteProc < LogStash::Inputs::Base
@@ -137,8 +152,6 @@ module LogStash
137
152
  ssh.properties['_commands'].each do |method, command|
138
153
  ssh.open_channel do |chan|
139
154
  chan.exec(command) do |ch, success|
140
- ch[:result_data] = String.new('')
141
- ch[:result_error] = String.new('')
142
155
  ch[:result_host] = ssh.properties['host']
143
156
  ch[:result_port] = ssh.properties['port']
144
157
  unless success
@@ -148,6 +161,8 @@ module LogStash
148
161
  port: ch[:result_port])
149
162
  next
150
163
  end
164
+ ch[:result_data] = String.new('')
165
+ ch[:result_error] = String.new('')
151
166
  # "on_data" called when the process writes to stdout
152
167
  ch.on_data { |_c, data| ch[:result_data] << data }
153
168
  ch.on_process do |_c|
@@ -212,7 +227,7 @@ module LogStash
212
227
  else
213
228
  COMMANDS.select { |k, _| @proc_list.include?(k.to_s) }
214
229
  end
215
- # Replace 'system_reader' and 'proc_prefix_path' in all commands
230
+ # Replace 'system_reader' and 'proc_prefix_path' for each host command
216
231
  server['_commands'] = cmds.each do |k, v|
217
232
  cmds[k] = v % { system_reader: server['system_reader'],
218
233
  proc_prefix_path: server['proc_prefix_path'] }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-remote_proc'
3
- s.version = '0.1.9'
3
+ s.version = '0.2.0'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'This Logstash plugin collects PROCFS metrics through remote SSH servers.'
6
6
  s.description = 'This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-remote_proc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kakesa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2016-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement