Capture network device info in health report (#18213)

This commit is contained in:
Shireesh Anjal
2023-10-13 04:03:31 +05:30
committed by GitHub
parent 20b79f8945
commit a66a7f3e97
8 changed files with 101 additions and 4 deletions

View File

@@ -2075,7 +2075,7 @@ func fetchHealthInfo(healthCtx context.Context, objectAPI ObjectLayer, query *ur
}
getAndWritePartitions := func() {
if query.Get("sysdrivehw") == "true" {
if query.Get(string(madmin.HealthDataTypeSysDriveHw)) == "true" {
localPartitions := madmin.GetPartitions(healthCtx, globalLocalNodeName)
anonymizeAddr(&localPartitions)
healthInfo.Sys.Partitions = append(healthInfo.Sys.Partitions, localPartitions)
@@ -2089,6 +2089,20 @@ func fetchHealthInfo(healthCtx context.Context, objectAPI ObjectLayer, query *ur
}
}
getAndWriteNetInfo := func() {
if query.Get(string(madmin.HealthDataTypeSysNet)) == "true" {
localNetInfo := madmin.GetNetInfo(globalLocalNodeName, globalInternodeInterface)
healthInfo.Sys.NetInfo = append(healthInfo.Sys.NetInfo, localNetInfo)
peerNetInfos := globalNotificationSys.GetNetInfo(healthCtx)
for _, n := range peerNetInfos {
anonymizeAddr(&n)
healthInfo.Sys.NetInfo = append(healthInfo.Sys.NetInfo, n)
}
partialWrite(healthInfo)
}
}
getAndWriteOSInfo := func() {
if query.Get("sysosinfo") == "true" {
localOSInfo := madmin.GetOSInfo(healthCtx, globalLocalNodeName)
@@ -2310,6 +2324,7 @@ func fetchHealthInfo(healthCtx context.Context, objectAPI ObjectLayer, query *ur
getAndWritePlatformInfo()
getAndWriteCPUs()
getAndWritePartitions()
getAndWriteNetInfo()
getAndWriteOSInfo()
getAndWriteMemInfo()
getAndWriteProcInfo()