Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions readjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ func jsonIsOk(logger *slog.Logger, json gjson.Result) bool {
if messages.Exists() {
for _, message := range messages.Array() {
if message.Get("severity").String() == "error" {
// if the string contains "GetLogPage failed", then ignore it
// this is a known issue with Apple internal SSDs
if strings.Contains(message.Get("string").String(), "GetLogPage failed") {
logger.Warn("Ignoring GetLogPage failed error", "device", json.Get("device.name").String(), "message", message.Get("string").String())
continue
}
logger.Error(message.Get("string").String())
return false
}
Expand Down
4 changes: 3 additions & 1 deletion smartctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ func extractDiskName(input string) string {

return strings.Join(name, "_")
}
return ""

// If the regex doesn't match, return the entire input string
return input
}

// NewSMARTctl is smartctl constructor
Expand Down