logstash-input-remote_proc 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: 886ba1d492c95c0694ec9ed3abdf50910938431b
4
- data.tar.gz: d682151c236ab91e4dcc0fd7bea32d0427e164f2
3
+ metadata.gz: 035fc8bc3778dcb99b27079eaf0d718d6046d52b
4
+ data.tar.gz: d33a58ba22ca37ac4de7e80d48714b99278e9b27
5
5
  SHA512:
6
- metadata.gz: aefdb9bdbafe54f033df51da644c9a92c554106d7bebf11a52954406c043160de4bfa24fd1d73a0c2246c8187c01abb604f9bc2b95e4f5c1eb87a1055d277885
7
- data.tar.gz: 7802100d3221161c90fbd000e78eb911ed5306dd5576061a649e89dd6ac5b7e8b261cbb0818707ba33dc7757229761e9c238075291add491849db4a21cde412e
6
+ metadata.gz: 83b1d89283ba50881e416746011b712bf63926c2397745f6233434f9808d61b5f62b5240921436c251c4d0cf51f6e520d36bb0bf5b4f8c6cd71a11233c0eb4ad
7
+ data.tar.gz: ec2b4d2a344848df5f17c3880970933e1084b435750c6a6253f2931c2c5aa6baf9ffe53e5fbd87a0eae28da572b7a1d9fe25d5a1b4ebe31c5c45c5ddacedc504
@@ -107,18 +107,16 @@ module LogStash
107
107
  channel = ssh.open_channel do |chan|
108
108
  chan.exec(command) do |ch, success|
109
109
  next unless success
110
-
111
110
  # "on_data" called when the process writes to stdout
112
111
  ch.on_data { |_c, data| result_data << data }
113
-
114
112
  # "on_extended_data", called when the process writes to stderr
115
113
  ch.on_extended_data { |_ch, _type, data| error_data << data }
116
-
117
114
  ch.on_close(&:close)
118
115
  end
119
116
  end
120
117
  channel.wait
121
118
  unless error_data.empty?
119
+ error_data.chomp!
122
120
  error_data = error_data.force_encoding('UTF-8')
123
121
  @logger.warn(error_data)
124
122
  next
@@ -132,8 +130,8 @@ module LogStash
132
130
  host: @host,
133
131
  type: @type || "system-#{method}",
134
132
  metric_name: "system-#{method}",
135
- remote_host: channel.connection.transport.host,
136
- remote_port: channel.connection.transport.port,
133
+ remote_host: channel.connection.options[:properties]['host'],
134
+ remote_port: channel.connection.options[:properties]['port'],
137
135
  command: command,
138
136
  message: result_data
139
137
  )
@@ -164,7 +162,7 @@ module LogStash
164
162
  @servers.each do |s|
165
163
  prepare_servers!(s)
166
164
 
167
- session_options = {}
165
+ session_options = { properties: s }
168
166
  session_options[:port] = s['port'] if s['port']
169
167
  session_options[:password] = s['password'] if s['password']
170
168
  if s['ssh_private_key']
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-remote_proc'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
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.0
4
+ version: 0.1.1
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-11-18 00:00:00.000000000 Z
11
+ date: 2016-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement