mperham/inspeqtor — pull request #51 by felixbuenemann (2014-11-22 02:35:24+00:00)
Title: Fix sysctl on osx with comma decimal separator

Mac OS X renders floats in sysctl output according to the locale specified by LANG, which breaks parsing by strconv.parseFloat if a decimal separator other than period is used:

```
LANG=de_DE.UTF-8 make
--- FAIL: TestCollectRealHostMetrics (0.03 seconds)
host_test.go:60: strconv.ParseFloat: parsing "2,99": invalid syntax
```

This PR changes the exec environment for the sysctl call to always set LANG=C to work around the problem.

Another approach could be to use Go's `syscall.Sysctl()`, but the current implementation doesn't handle non-string return values and eg vm.loadavg on OS X returns a struct (see `man 3 sysctl`).