collector

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(cfg *config.Config) (*types.SystemInfo, error)

Collect gathers all requested system information

func CollectBattery added in v1.0.3

func CollectBattery() (*types.BatteryData, error)

CollectBattery collects battery information on Linux

func CollectCPU

func CollectCPU() (*types.CPUData, error)

CollectCPU gathers CPU information

func CollectDisk

func CollectDisk(includeSMART bool) (*types.DiskData, error)

CollectDisk gathers disk and partition information

func CollectGPU

func CollectGPU() (*types.GPUData, error)

CollectGPU gathers GPU information

func CollectMemory

func CollectMemory() (*types.MemoryData, error)

CollectMemory gathers memory information

func CollectNetwork

func CollectNetwork() (*types.NetworkData, error)

CollectNetwork gathers network interface information

func CollectProcesses

func CollectProcesses() (*types.ProcessData, error)

CollectProcesses gathers process information

func CollectSMART

func CollectSMART() []types.SMARTInfo

CollectSMART gathers SMART data from drives

func CollectSystem

func CollectSystem() (*types.SystemData, error)

CollectSystem gathers general system information

Types

type AtaSmartAttrs

type AtaSmartAttrs struct {
	Table []SmartAttribute `json:"table"`
}

type DmidecodeMemory

type DmidecodeMemory struct {
	Handle          string `json:"handle"`
	Type            string `json:"type"`
	Size            string `json:"size"`
	FormFactor      string `json:"form_factor"`
	Locator         string `json:"locator"`
	BankLocator     string `json:"bank_locator"`
	MemoryType      string `json:"type_detail"`
	Speed           string `json:"speed"`
	Manufacturer    string `json:"manufacturer"`
	SerialNumber    string `json:"serial_number"`
	PartNumber      string `json:"part_number"`
	ConfiguredSpeed string `json:"configured_memory_speed"`
}

DmidecodeMemory represents dmidecode memory device output

type NvidiaGPU

type NvidiaGPU struct {
	ProductName string `xml:"product_name"`
	UUID        string `xml:"uuid"`
	PCIBus      string `xml:"pci>pci_bus"`
	Temperature struct {
		Current string `xml:"gpu_temp"`
	} `xml:"temperature"`
	Utilization struct {
		GPU    string `xml:"gpu_util"`
		Memory string `xml:"memory_util"`
	} `xml:"utilization"`
	FBMemory struct {
		Total string `xml:"total"`
		Used  string `xml:"used"`
		Free  string `xml:"free"`
	} `xml:"fb_memory_usage"`
	Power struct {
		Draw  string `xml:"power_draw"`
		Limit string `xml:"power_limit"`
	} `xml:"power_readings"`
	Clocks struct {
		Graphics string `xml:"graphics_clock"`
		Memory   string `xml:"mem_clock"`
	} `xml:"clocks"`
	FanSpeed      string `xml:"fan_speed"`
	DriverVersion string `xml:"driver_version"`
}

type NvidiaSMILog

type NvidiaSMILog struct {
	GPUs []NvidiaGPU `xml:"gpu"`
}

NvidiaSMILog represents the XML output from nvidia-smi

type NvmeSmartLog

type NvmeSmartLog struct {
	Temperature      int    `json:"temperature"`
	PowerOnHours     uint64 `json:"power_on_hours"`
	DataUnitsRead    uint64 `json:"data_units_read"`
	DataUnitsWritten uint64 `json:"data_units_written"`
}

type PowerOnTime

type PowerOnTime struct {
	Hours uint64 `json:"hours"`
}

type SmartAttribute

type SmartAttribute struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Value      int    `json:"value"`
	Worst      int    `json:"worst"`
	Threshold  int    `json:"thresh"`
	RawValue   int64  `json:"raw_value"`
	RawString  string `json:"raw"`
	WhenFailed string `json:"when_failed"`
}

type SmartStatus

type SmartStatus struct {
	Passed bool `json:"passed"`
}

type SmartctlOutput

type SmartctlOutput struct {
	Device struct {
		Name     string `json:"name"`
		InfoName string `json:"info_name"`
		Type     string `json:"type"`
		Protocol string `json:"protocol"`
	} `json:"device"`
	ModelFamily   string        `json:"model_family"`
	ModelName     string        `json:"model_name"`
	SerialNumber  string        `json:"serial_number"`
	UserCapacity  UserCapacity  `json:"user_capacity"`
	SmartStatus   SmartStatus   `json:"smart_status"`
	Temperature   Temperature   `json:"temperature"`
	PowerOnTime   PowerOnTime   `json:"power_on_time"`
	AtaSmartAttrs AtaSmartAttrs `json:"ata_smart_attributes"`
	NvmeSmartLog  NvmeSmartLog  `json:"nvme_smart_health_information_log"`
}

SmartctlOutput represents the JSON output from smartctl

type Temperature

type Temperature struct {
	Current int `json:"current"`
}

type UserCapacity

type UserCapacity struct {
	Blocks uint64 `json:"blocks"`
	Bytes  uint64 `json:"bytes"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL