Skip to content

Commit

Permalink
Capture drive major/minor in health report (#334)
Browse files Browse the repository at this point in the history
Also add a field to capture tier configs.
  • Loading branch information
anjalshireesh authored and harshavardhana committed Feb 20, 2025
1 parent b654dcb commit 206c37e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions health.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ type Partition struct {
Error string `json:"error,omitempty"`

Device string `json:"device,omitempty"`
Major uint32 `json:"major"`
Minor uint32 `json:"minor"`
Model string `json:"model,omitempty"`
Revision string `json:"revision,omitempty"`
Mountpoint string `json:"mountpoint,omitempty"`
Expand Down Expand Up @@ -278,6 +280,8 @@ type Partitions struct {
type driveHwInfo struct {
Model string
Revision string
Major uint32
Minor uint32
}

func getDriveHwInfo(partDevice string) (info driveHwInfo, err error) {
Expand All @@ -296,6 +300,16 @@ func getDriveHwInfo(partDevice string) (info driveHwInfo, err error) {
}

majorMinor := strings.TrimSpace(string(data))
mm := strings.SplitN(majorMinor, ":", 2)
major, err := strconv.ParseUint(mm[0], 10, 32)
if err == nil {
info.Major = uint32(major)
}
minor, err := strconv.ParseUint(mm[1], 10, 32)
if err == nil {
info.Minor = uint32(minor)
}

driveInfoPath := runDevDataPfx + majorMinor

var f *os.File
Expand Down Expand Up @@ -374,6 +388,8 @@ func GetPartitions(ctx context.Context, addr string) Partitions {
InodeFree: usage.InodesFree,
Model: di.Model,
Revision: di.Revision,
Major: di.Major,
Minor: di.Minor,
})
}
}
Expand Down Expand Up @@ -1053,6 +1069,7 @@ type MinioInfo struct {
IsKubernetes *bool `json:"is_kubernetes"`
IsDocker *bool `json:"is_docker"`
Metrics *RealtimeMetrics `json:"metrics,omitempty"`
TierConfigs []TierConfig `json:"tier_configs,omitempty"`
}

type TLSInfo struct {
Expand Down

0 comments on commit 206c37e

Please sign in to comment.