mirror of
https://github.com/henrygd/beszel.git
synced 2026-08-19 16:57:47 +02:00
fix(agent): add fallback for CPU model detection on MIPS architectures (#2138)
gopsutil's cpu.Info() does not parse the 'cpu model' field from /proc/cpuinfo, which is the only source of CPU model names on MIPS. Add a fallback that reads /proc/cpuinfo directly and combines 'cpu model' (e.g. 'MIPS 1004Kc V2.15') with 'system type' (e.g. 'MediaTek MT7621 ver:1 eco:3') for a complete identifier. The fallback only triggers when gopsutil returns an empty ModelName, so x86/ARM/other architectures are unaffected.
This commit is contained in:
@@ -50,6 +50,9 @@ func generateFingerprint(hostname, cpuModel string) string {
|
||||
if info, err := cpu.Info(); err == nil && len(info) > 0 {
|
||||
cpuModel = info[0].ModelName
|
||||
}
|
||||
if cpuModel == "" {
|
||||
cpuModel = getCpuModelFromCpuinfo()
|
||||
}
|
||||
}
|
||||
fingerprint = hostname + cpuModel
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user