Closed pvlltvk closed 7 years ago
@pvlltvk could you put together a pr?
Ideally I would like to make it more durable than just setting the locale (which assumes it's installed). But I'd take this if you can't come up with something else.
@pvlltvk I put together: https://github.com/sensu-plugins/sensu-plugins-network-checks/pull/55 to address this by allowing you to pass in the right value rather than assuming you have en_US.UTF8
available, can you verify this works?
metris-netif use sar to generate netif metrics and grep sar output by word "Average":
sar -n DEV 1 1 | grep Average | grep -v IFACE
.each_line do |line|`But it's wrong way, if defalut system locale is't en_US.UTF-8. For example ru_RU.UTF-8, where "Average" translated to "Среднее":
sar -n DEV 1 1
11:03:33 eth0 79,00 36,00 43,28 4,28 0,00 0,00 0,00 0,03
Среднее: eth0 79,00 36,00 43,28 4,28 0,00 0,00 0,00 0,03
It can be easliy fixed by using env LANG:
LANG=en_US.UTF8 && sar -n DEV 1 1 | grep Average | grep -v IFACE
.each_line do |line|`