mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-28 08:26:18 +01:00
S.M.A.R.T support (#614)
* add agent smart support * refactor(system): update JSON tags in SmartData struct * refactor(agent): use serial number as the key of SmartDataMap Updated the SmartManager's methods to use the device's serial number as the key in the SmartDataMap instead of the device name. * refactor: use raw values in smart attributes for nvme devices * feat: add S.M.A.R.T. data display in web ui Introduced a new Disks tab in the SystemDetail component to display disk information and S.M.A.R.T. data. The tab includes a table for visualizing disk attributes and their statuses. Also added SmartData and SmartAttribute interfaces to support the new functionality.
This commit is contained in:
@@ -25,6 +25,7 @@ type Agent struct {
|
||||
systemInfo system.Info // Host system info
|
||||
gpuManager *GPUManager // Manages GPU data
|
||||
cache *SessionCache // Cache for system stats based on primary session ID
|
||||
smartManager *SmartManager // Manages SMART data
|
||||
}
|
||||
|
||||
func NewAgent() *Agent {
|
||||
@@ -62,6 +63,12 @@ func NewAgent() *Agent {
|
||||
agent.gpuManager = gm
|
||||
}
|
||||
|
||||
if sm, err := NewSmartManager(); err != nil {
|
||||
slog.Debug("SMART", "err", err)
|
||||
} else {
|
||||
agent.smartManager = sm
|
||||
}
|
||||
|
||||
// if debugging, print stats
|
||||
if agent.debug {
|
||||
slog.Debug("Stats", "data", agent.gatherStats(""))
|
||||
|
||||
Reference in New Issue
Block a user