summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/lvm/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/collectors/go.d.plugin/modules/lvm/init.go')
-rw-r--r--src/go/collectors/go.d.plugin/modules/lvm/init.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/lvm/init.go b/src/go/collectors/go.d.plugin/modules/lvm/init.go
new file mode 100644
index 0000000000..057e51dd59
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/modules/lvm/init.go
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package lvm
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+
+ "github.com/netdata/netdata/go/go.d.plugin/agent/executable"
+)
+
+func (l *LVM) initLVMCLIExec() (lvmCLI, error) {
+ ndsudoPath := filepath.Join(executable.Directory, "ndsudo")
+ if _, err := os.Stat(ndsudoPath); err != nil {
+ return nil, fmt.Errorf("ndsudo executable not found: %v", err)
+
+ }
+
+ lvmExec := newLVMCLIExec(ndsudoPath, l.Timeout.Duration(), l.Logger)
+
+ return lvmExec, nil
+}