logstash-plugins / logstash-input-wmi

Apache License 2.0
3 stars 7 forks source link

WMI input throws no such file racob_fix on Windows #6

Closed jordansissel closed 9 years ago

jordansissel commented 9 years ago

(This issue was originally filed by @LeRiton at https://github.com/elastic/logstash-contrib/issues/123)


Hi,

This issue was first described on the logstash-users ML.

Environment is Windows x64, JDK 1.7_40 x64.

Using this minimal logstash.conf

input {
    wmi {
        query => "select PercentProcessorTime from Win32_PerfFormattedData_PerfOS_Processor where name = '_Total'"
    }
}
output {
  stdout { codec => rubydebug }
}

throws

D:\path\to\logstash-1.4.2>bin\logstash agent -f logstash.conf
Using milestone 1 input plugin 'wmi'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin.  For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
LoadError: no such file to load -- logstash/inputs/eventlog/racob_fix
    require at org/jruby/RubyKernel.java:1085
    require at file:/D:/path/to/logstash-1.4.2/vendor/jar/jruby-complete-1.7.11.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
    require at file:/D:/path/to/logstash-1.4.2/vendor/jar/jruby-complete-1.7.11.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53
    require at D:/path/to/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/polyglot-0.3.4/lib/polyglot.rb:65
    register at D:/path/to/logstash-1.4.2/lib/logstash/inputs/wmi.rb:41
    start_inputs at D:/path/to/logstash-1.4.2/lib/logstash/pipeline.rb:135
    each at org/jruby/RubyArray.java:1613
    start_inputs at D:/path/to/logstash-1.4.2/lib/logstash/pipeline.rb:134
    run at D:/path/to/logstash-1.4.2/lib/logstash/pipeline.rb:72
    execute at D:/path/to/logstash-1.4.2/lib/logstash/agent.rb:139
    run at D:\path\to\logstash-1.4.2\lib\logstash\runner.rb:168
    call at org/jruby/RubyProc.java:271
    initialize at D:/path/to/logstash-1.4.2/vendor/bundle/jruby/1.9/gems/stud-0.0.17/lib/stud/task.rb:12

Thanks to Clément's proposal, commenting L41 fix this error, everything seems OK but I don't know if the modification can break something else.

if RUBY_PLATFORM == "java"
  # make use of the same fix used for the eventlog input
  #require "logstash/inputs/eventlog/racob_fix"
  require "jruby-win32ole"
else
  require "win32ole"
end
wiibaa commented 9 years ago

@suyograo @jordansissel already fixed with https://github.com/elastic/logstash-contrib/pull/69 before moving to this repo but issue was left open