Add temp input plugin (#4411)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/shirou/gopsutil/cpu"
|
||||
"github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/host"
|
||||
"github.com/shirou/gopsutil/mem"
|
||||
"github.com/shirou/gopsutil/net"
|
||||
)
|
||||
@@ -23,6 +24,7 @@ type PS interface {
|
||||
VMStat() (*mem.VirtualMemoryStat, error)
|
||||
SwapStat() (*mem.SwapMemoryStat, error)
|
||||
NetConnections() ([]net.ConnectionStat, error)
|
||||
Temperature() ([]host.TemperatureStat, error)
|
||||
}
|
||||
|
||||
type PSDiskDeps interface {
|
||||
@@ -168,6 +170,10 @@ func (s *SystemPS) SwapStat() (*mem.SwapMemoryStat, error) {
|
||||
return mem.SwapMemory()
|
||||
}
|
||||
|
||||
func (s *SystemPS) Temperature() ([]host.TemperatureStat, error) {
|
||||
return host.SensorsTemperatures()
|
||||
}
|
||||
|
||||
func (s *SystemPSDisk) Partitions(all bool) ([]disk.PartitionStat, error) {
|
||||
return disk.Partitions(all)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user