mirror of https://github.com/shirou/gopsutil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
378 B
Go
21 lines
378 B
Go
11 years ago
|
// +build freebsd
|
||
|
|
||
|
package gopsutil
|
||
|
|
||
|
import (
|
||
|
"os/exec"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
10 years ago
|
func DoSysctrl(mib string) ([]string, error) {
|
||
11 years ago
|
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
|
||
|
if err != nil {
|
||
|
return []string{}, err
|
||
|
}
|
||
|
v := strings.Replace(string(out), "{ ", "", 1)
|
||
|
v = strings.Replace(string(v), " }", "", 1)
|
||
|
values := strings.Fields(string(v))
|
||
|
|
||
|
return values, nil
|
||
|
}
|