Error in WMI input plugin

Hi,

I am trying to collect the performance counters on the windows system using the below configuration. But I am getting the following error. Please suggest me any solution to overcome the error.

The error reported is:
undefined method `value' for nil:NilClass

Here is my config file.

input {
wmi {
query => "select * from Win32_PerfFormattedData_PerfOS_Processor"
}
}
output
{
stdout
{
codec => rubydebug
}
}
Please suggest me if there is any other way through which I can collect the performance counters of the system.

Thanks,

Hi,

I also face the same issue and after debugging I figured out the root cause :slight_smile:

In the file logstash-2.3.2\vendor\bundle\jruby\1.9\gems\logstash-input-wmi-2.0.5-java\lib\logstash\inputs\wmi.rb

line# 49 has statement @host = Socket.gethostname and the result is not either of 127.0.0.1 or localhost so the if condition is going to else and looking for password value

Fix:

modify the if condition to include the hostname of your mahcine, see below example:
if (@host == "127.0.0.1" || @host == "localhost" || @host == "::1" || @host=="mymachinename")

Thanks,
Jagadish