about summary refs log tree commit diff
path: root/main/osinfo/osinfo_freebsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/osinfo/osinfo_freebsd.go')
-rw-r--r--main/osinfo/osinfo_freebsd.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/osinfo/osinfo_freebsd.go b/main/osinfo/osinfo_freebsd.go
new file mode 100644
index 0000000..543f2ff
--- /dev/null
+++ b/main/osinfo/osinfo_freebsd.go
@@ -0,0 +1,24 @@
+// Unless explicitly stated otherwise all files in this repository are licensed
+// under the Apache License Version 2.0.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2016 Datadog, Inc.
+
+package osinfo
+
+import (
+	"os/exec"
+	"runtime"
+	"strings"
+)
+
+func osName() string {
+	return runtime.GOOS
+}
+
+func osVersion() string {
+	out, err := exec.Command("uname", "-r").Output()
+	if err != nil {
+		return "unknown"
+	}
+	return strings.Split(string(out), "-")[0]
+}