blob: 7196208e801b6c7f367ae24e4df68ee41045b57a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// SPDX-License-Identifier: GPL-3.0-or-later
package nvme
import (
"fmt"
"os"
"path/filepath"
"github.com/netdata/netdata/go/plugins/pkg/executable"
)
func (n *NVMe) initNVMeCLIExec() (nvmeCLI, error) {
ndsudoPath := filepath.Join(executable.Directory, "ndsudo")
if _, err := os.Stat(ndsudoPath); err != nil {
return nil, fmt.Errorf("ndsudo executable not found: %v", err)
}
nvmeExec := &nvmeCLIExec{
ndsudoPath: ndsudoPath,
timeout: n.Timeout.Duration(),
}
return nvmeExec, nil
}
|