Add Linux mdraid health monitoring (#1750)

This commit is contained in:
VACInc
2026-02-27 13:42:47 -05:00
committed by GitHub
parent 69fdcb36ab
commit 02c1a0c13d
7 changed files with 393 additions and 17 deletions

24
agent/file_utils.go Normal file
View File

@@ -0,0 +1,24 @@
package agent
import (
"os"
"strings"
)
func readStringFile(path string) string {
content, _ := readStringFileOK(path)
return content
}
func readStringFileOK(path string) (string, bool) {
b, err := os.ReadFile(path)
if err != nil {
return "", false
}
return strings.TrimSpace(string(b)), true
}
func fileExists(path string) bool {
_, err := os.Stat(path)
return err == nil
}