|
@@ -206,7 +206,6 @@ func GetNetworkInterfaceStats() (int64, int64, error) {
|
|
|
defer cmd.Process.Kill()
|
|
|
|
|
|
//Filter out the first line
|
|
|
-
|
|
|
lines := strings.Split(strings.ReplaceAll(string(out), "\r\n", "\n"), "\n")
|
|
|
if len(lines) >= 2 && len(lines[1]) >= 0 {
|
|
|
dataLine := lines[1]
|
|
@@ -235,6 +234,7 @@ func GetNetworkInterfaceStats() (int64, int64, error) {
|
|
|
return rx * 4, tx * 4, nil
|
|
|
} else {
|
|
|
//Invalid data
|
|
|
+ log.Println("invalid wmic results: ", lines)
|
|
|
return 0, 0, errors.New("Invalid wmic results")
|
|
|
}
|
|
|
|