Add -W flag to netstat on BSD systems

This prevents netstat from truncating the interface name to 5
characters. See https://github.com/influxdb/telegraf/issues/438
This commit is contained in:
Cameron Sparr 2015-12-15 08:27:12 -07:00
parent de9cd47bb0
commit 432bcbd056
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import (
// lo0 16384 ::1/128 ::1 869107 - 169411755 869107 - 169411755 - -
// lo0 16384 127 127.0.0.1 869107 - 169411755 869107 - 169411755 - -
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
out, err := exec.Command("/usr/sbin/netstat", "-ibdn").Output()
out, err := exec.Command("/usr/sbin/netstat", "-ibdnW").Output()
if err != nil {
return nil, err
}

View File

@ -12,7 +12,7 @@ import (
)
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
out, err := exec.Command("/usr/bin/netstat", "-ibdn").Output()
out, err := exec.Command("/usr/bin/netstat", "-ibdnW").Output()
if err != nil {
return nil, err
}