sensu-plugins / sensu-plugins-windows

Sensu Windows Plugins
http://sensu-plugins.io
MIT License
22 stars 46 forks source link

Fixes for issue #16 and French #17

Closed bgaillard closed 7 years ago

bgaillard commented 8 years ago

Pull Request Checklist

Is this in reference to an existing issue?

Fixes for issue #16 and French.

Make plugins compliants with Operating Systems configured in French. This also add a first sample to helper other users add supports for other locales (Spanish, Italian, etc.).

bgaillard commented 8 years ago

After reflexion I think my implementation is perhaps a little "brittle".

Perhaps it would be better to add an --os-language parameter which would accept an ISO 639-1 code.

For example.

check-windows-disk.rb -w 85 -c 95 --os-language FR

What do you think about that ?

eheydrick commented 8 years ago

I think passing in the language would work well. Or is there an environment variable or other command that could be used to determine the language setting?

majormoses commented 7 years ago

@bgaillard any plans to circle back to this?

majormoses commented 7 years ago

@eheydrick From what I googled (exists as far back as XP) and validated (at home on windows 10) we could get it from systeminfo.exe which returned something like this:

PS C:\Users\majormoses> systeminfo.exe | findstr "Locale"
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)

It looks like there might also be some registry values we can pull from as well: http://windowsitpro.com/systems-management/where-registry-language-setting-each-user-stored which has 2 registry entries but I dont think we need to check them both because it appears to require a reboot to apply change? Sigh windows and its need to reboot for pretty much any change to the system.

Honestly I have no idea how we should go about it, someone with more windows chops should probably comment here...

eheydrick commented 7 years ago

Interesting, that looks promising.

majormoses commented 7 years ago

Lets take this back into the issue to discuss this is too brittle imho.