logstash-input-wmi 2.0.4-java → 2.0.5-java

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: a65c67d4782245d287844253fa25deadccd6cdd3
4
- data.tar.gz: 3b4488355d6a24a460faeece19db091f6b5e9180
3
+ metadata.gz: ba2ce1c8132e67f94c53bfdaccf85ab08abe875d
4
+ data.tar.gz: 1d64ce45e3526ab906f0db66e02b6716f526625d
5
5
  SHA512:
6
- metadata.gz: f2fda0bdce8c60a5a20095211c33545cd02c0a4aa1df665e4a0ec9820f1b26ebd7ef110376dc4f769e3a2cde90d4a472e73238c86301131f0863bd30700405bc
7
- data.tar.gz: acfae9a6e09ff23e2c6ac43186aac131c2a6af8f7dc74bdc4ae14bae7c78ebcb805800c71f129d3ba5a4a1180b26c1f7206c6c5ae23784f672be820dfafceeaf
6
+ metadata.gz: eca7d56fa4f85fda1c8d9428fbf1932c21dd6a952572b1f33e430f46b330fd404a34f398637b54d4b058f5c1e17a397b84040ecf48efff9280e79f65eaed7162
7
+ data.tar.gz: 9d460d51f6946310f9cc29ad0415297f07042026588c3ceacd0cb744b432f0dfb948b4a06c29d0d53da05adc31f3368e8e2e4acf63ed173a97a63eac8d7bf912
@@ -19,6 +19,12 @@ require "socket"
19
19
  # wmi {
20
20
  # query => "select PercentProcessorTime from Win32_PerfFormattedData_PerfOS_Processor where name = '_Total'"
21
21
  # }
22
+ # wmi { # Connect to a remote host
23
+ # query => "select * from Win32_Process"
24
+ # host => "MyRemoteHost"
25
+ # user => "mydomain\myuser"
26
+ # password => "Password"
27
+ # }
22
28
  # }
23
29
  class LogStash::Inputs::WMI < LogStash::Inputs::Base
24
30
 
@@ -28,7 +34,15 @@ class LogStash::Inputs::WMI < LogStash::Inputs::Base
28
34
  config :query, :validate => :string, :required => true
29
35
  # Polling interval
30
36
  config :interval, :validate => :number, :default => 10
31
-
37
+ # Host to connect to ( Defaults to localhost )
38
+ config :host, :validate => :string, :default => 'localhost'
39
+ # Username when doing remote connections
40
+ config :user, :validate => :string
41
+ # Password when doing remote connections
42
+ config :password, :validate => :password
43
+ # Namespace when doing remote connections
44
+ config :namespace, :validate => :string, :default => 'root\cimv2'
45
+
32
46
  public
33
47
  def register
34
48
 
@@ -40,12 +54,21 @@ class LogStash::Inputs::WMI < LogStash::Inputs::Base
40
54
  else
41
55
  require "win32ole"
42
56
  end
57
+
58
+ # If host is localhost do a local connection
59
+ if (@host == "127.0.0.1" || @host == "localhost" || @host == "::1")
60
+ @wmi = WIN32OLE.connect('winmgmts:')
61
+ @host = Socket.gethostname
62
+ else
63
+ locator = WIN32OLE.new("WbemScripting.SWbemLocator")
64
+ @host = Socket.gethostbyname(@host).first
65
+ @wmi = locator.ConnectServer(@host, @namespace, @user, @password.value)
66
+ end
43
67
  end # def register
44
68
 
45
69
  public
46
70
  def run(queue)
47
- @wmi = WIN32OLE.connect("winmgmts://")
48
-
71
+
49
72
  begin
50
73
  @logger.debug("Executing WMI query '#{@query}'")
51
74
  loop do
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-wmi'
4
- s.version = '2.0.4'
4
+ s.version = '2.0.5'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Collect data from WMI query"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-wmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
14
20
  requirement: !ruby/object:Gem::Requirement
15
21
  requirements:
16
- - - "~>"
22
+ - - ~>
17
23
  - !ruby/object:Gem::Version
18
24
  version: '1.0'
19
- name: logstash-core-plugin-api
20
25
  prerelease: false
21
26
  type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ name: jruby-win32ole
22
29
  version_requirements: !ruby/object:Gem::Requirement
23
30
  requirements:
24
- - - "~>"
31
+ - - '>='
25
32
  - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
33
+ version: '0'
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
30
- - - ">="
36
+ - - '>='
31
37
  - !ruby/object:Gem::Version
32
38
  version: '0'
33
- name: jruby-win32ole
34
39
  prerelease: false
35
40
  type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ name: logstash-devutils
36
43
  version_requirements: !ruby/object:Gem::Requirement
37
44
  requirements:
38
- - - ">="
45
+ - - '>='
39
46
  - !ruby/object:Gem::Version
40
47
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
48
  requirement: !ruby/object:Gem::Requirement
43
49
  requirements:
44
- - - ">="
50
+ - - '>='
45
51
  - !ruby/object:Gem::Version
46
52
  version: '0'
47
- name: logstash-devutils
48
53
  prerelease: false
49
54
  type: :development
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
55
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
56
56
  email: info@elastic.co
57
57
  executables: []
@@ -79,12 +79,12 @@ require_paths:
79
79
  - lib
80
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ">="
82
+ - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []