Fixed cpu count and cpu usage reporting on node.

This commit is contained in:
Jan Lošťák
2024-05-29 19:37:46 +02:00
parent 19d61f1091
commit 6a5167c14f

View File

@@ -248,6 +248,8 @@ func (c *PveNodeStatusCollector) CollectMetrics() error {
return err return err
} else { } else {
c.state.With(labels).Set(float64(node.Online)) c.state.With(labels).Set(float64(node.Online))
c.cpus.With(labels).Set(float64(status.CPUInfo.CPUs))
c.cpuUsage.With(labels).Set(float64(status.CPU))
c.uptime.With(labels).Set(float64(status.Uptime)) c.uptime.With(labels).Set(float64(status.Uptime))
c.memBytes.With(labels).Set(float64(status.Memory.Total)) c.memBytes.With(labels).Set(float64(status.Memory.Total))
c.memBytesUsed.With(labels).Set(float64(status.Memory.Used)) c.memBytesUsed.With(labels).Set(float64(status.Memory.Used))