sensu-plugins / sensu-plugins-windows

Sensu Windows Plugins

Home Page:http://sensu-plugins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

check-windows-ram.rb

mikeeaton83 opened this issue · comments

Hi,

The above plugin reports the following error, but only on one of my servers:

output Check failed to run: undefined method length' for nil:NilClass, ["c:/opt/sensu/plugins/check-windows-ram.rb:45:in acquire_ram_usage'", "c:/opt/sensu/plugins/check-windows-ram.rb:54:in `run'", "c:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.

It's a Windows Server. 2003 Standard 32bit with Service Pack 2.

Not sure what other details you need?

Thanks,

Michael

Hi @if-meaton

i am very optimistic that you dont have a english languagepack on that particular server.
i ve had the same problem. the cause is the typeperf command wich will look for english named counters wich are not known on servers with other languages installed.

My Solution was to export all counters with
C:>TypePerf.exe –q > counters.txt
search through the export and replace the counternames with those from the export in your language.

Best
Dennis

Hey,

The perf counters where corrupt, i ran this:

C:\Windows\System32>lodctr /R

Info: Successfully rebuilt performance counter setting from system backup store

which fixed my issue.

Thanks,

Michael

@if-meaton any chance we could get you to put a PR to document this in the readme?

@majormoses Didn't see this in the readme yet. thought I'd take care of it!

This has been documented in #64 if there is anything else to do please respond back and we can open the issue.