model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertEvent

type AlertEvent struct {
	ID          string     `json:"id" yaml:"id"`
	RuleID      string     `json:"rule_id" yaml:"rule_id"`
	RuleName    string     `json:"rule_name" yaml:"rule_name"`
	Severity    Severity   `json:"severity" yaml:"severity"`
	Message     string     `json:"message" yaml:"message"`
	MetricName  string     `json:"metric_name" yaml:"metric_name"`
	ActualValue float64    `json:"actual_value" yaml:"actual_value"`
	Threshold   float64    `json:"threshold" yaml:"threshold"`
	FiredAt     time.Time  `json:"fired_at" yaml:"fired_at"`
	ResolvedAt  *time.Time `json:"resolved_at,omitempty" yaml:"resolved_at,omitempty"`
	IsActive    bool       `json:"is_active" yaml:"is_active"`
}

AlertEvent represents a fired alert.

type AlertRule

type AlertRule struct {
	ID        string   `json:"id" yaml:"id"`
	Name      string   `json:"name" yaml:"name"`
	Metric    string   `json:"metric" yaml:"metric"`     // cpu_usage, mem_usage, disk_usage, process_cpu
	Operator  string   `json:"operator" yaml:"operator"` // >, >=, <, <=, ==
	Threshold float64  `json:"threshold" yaml:"threshold"`
	Duration  string   `json:"duration" yaml:"duration"` // e.g., 30s, 1m
	Severity  Severity `json:"severity" yaml:"severity"` // INFO, WARNING, CRITICAL
	Cooldown  string   `json:"cooldown" yaml:"cooldown"` // e.g. 5m
	Enabled   bool     `json:"enabled" yaml:"enabled"`
}

AlertRule defines conditions to trigger an alert.

type AlertStatus

type AlertStatus string

AlertStatus represents the state of an alert.

const (
	AlertStatusActive   AlertStatus = "ACTIVE"
	AlertStatusResolved AlertStatus = "RESOLVED"
	AlertStatusSilenced AlertStatus = "SILENCED"
)

type AnomalyReport

type AnomalyReport struct {
	TotalChecked   int            `json:"total_checked" yaml:"total_checked"`
	AnomaliesCount int            `json:"anomalies_count" yaml:"anomalies_count"`
	Scores         []AnomalyScore `json:"scores" yaml:"scores"`
	GeneratedAt    time.Time      `json:"generated_at" yaml:"generated_at"`
}

AnomalyReport contains anomalies across tracked metrics.

type AnomalyScore

type AnomalyScore struct {
	MetricName   string    `json:"metric_name" yaml:"metric_name"`
	CurrentValue float64   `json:"current_value" yaml:"current_value"`
	Mean         float64   `json:"mean" yaml:"mean"`
	StdDev       float64   `json:"std_dev" yaml:"std_dev"`
	ZScore       float64   `json:"z_score" yaml:"z_score"`
	EWMA         float64   `json:"ewma" yaml:"ewma"`
	DeviationPct float64   `json:"deviation_pct" yaml:"deviation_pct"`
	IsAnomaly    bool      `json:"is_anomaly" yaml:"is_anomaly"`
	Severity     Severity  `json:"severity" yaml:"severity"`
	Explanation  string    `json:"explanation" yaml:"explanation"`
	DetectedAt   time.Time `json:"detected_at" yaml:"detected_at"`
}

AnomalyScore describes statistical deviation.

type CPUCoreInfo

type CPUCoreInfo struct {
	Index       int     `json:"index" yaml:"index"`
	ModelName   string  `json:"model_name,omitempty" yaml:"model_name,omitempty"`
	MHz         float64 `json:"mhz" yaml:"mhz"`
	UsagePct    float64 `json:"usage_pct" yaml:"usage_pct"`
	Temperature float64 `json:"temperature,omitempty" yaml:"temperature,omitempty"`
}

CPUCoreInfo represents per-core metrics.

type CPUInfo

type CPUInfo struct {
	ModelName      string        `json:"model_name" yaml:"model_name"`
	VendorID       string        `json:"vendor_id" yaml:"vendor_id"`
	PhysicalCores  int           `json:"physical_cores" yaml:"physical_cores"`
	LogicalCores   int           `json:"logical_cores" yaml:"logical_cores"`
	OverallUsage   float64       `json:"overall_usage_pct" yaml:"overall_usage_pct"`
	Cores          []CPUCoreInfo `json:"cores" yaml:"cores"`
	LoadAverage    LoadAvg       `json:"load_average" yaml:"load_average"`
	FrequencyMHz   float64       `json:"frequency_mhz" yaml:"frequency_mhz"`
	TemperatureAvg float64       `json:"temperature_avg,omitempty" yaml:"temperature_avg,omitempty"`
	CollectedAt    time.Time     `json:"collected_at" yaml:"collected_at"`
}

CPUInfo represents consolidated CPU metrics.

type ConnectionInfo

type ConnectionInfo struct {
	Fd            uint32 `json:"fd,omitempty" yaml:"fd,omitempty"`
	Family        string `json:"family" yaml:"family"`
	Type          string `json:"type" yaml:"type"` // TCP, UDP
	LocalAddress  string `json:"local_address" yaml:"local_address"`
	LocalPort     uint32 `json:"local_port" yaml:"local_port"`
	RemoteAddress string `json:"remote_address" yaml:"remote_address"`
	RemotePort    uint32 `json:"remote_port" yaml:"remote_port"`
	Status        string `json:"status" yaml:"status"` // LISTEN, ESTABLISHED, etc.
	PID           int32  `json:"pid" yaml:"pid"`
	ProcessName   string `json:"process_name,omitempty" yaml:"process_name,omitempty"`
}

ConnectionInfo represents an active socket connection.

type ContainerStats

type ContainerStats struct {
	CPUPercent     float64 `json:"cpu_percent" yaml:"cpu_percent"`
	MemoryUsage    uint64  `json:"memory_usage_bytes" yaml:"memory_usage_bytes"`
	MemoryLimit    uint64  `json:"memory_limit_bytes" yaml:"memory_limit_bytes"`
	MemoryPercent  float64 `json:"memory_percent" yaml:"memory_percent"`
	NetworkRxBytes uint64  `json:"network_rx_bytes" yaml:"network_rx_bytes"`
	NetworkTxBytes uint64  `json:"network_tx_bytes" yaml:"network_tx_bytes"`
	BlockReadBytes uint64  `json:"block_read_bytes" yaml:"block_read_bytes"`
	BlockWriteByte uint64  `json:"block_write_bytes" yaml:"block_write_bytes"`
	PIDs           uint64  `json:"pids" yaml:"pids"`
}

ContainerStats represents resource metrics for a container.

type DiagnosticReport

type DiagnosticReport struct {
	OverallStatus  DiagnosticStatus   `json:"overall_status" yaml:"overall_status"`
	TotalChecks    int                `json:"total_checks" yaml:"total_checks"`
	PassedChecks   int                `json:"passed_checks" yaml:"passed_checks"`
	WarningChecks  int                `json:"warning_checks" yaml:"warning_checks"`
	CriticalChecks int                `json:"critical_checks" yaml:"critical_checks"`
	Results        []DiagnosticResult `json:"results" yaml:"results"`
	GeneratedAt    time.Time          `json:"generated_at" yaml:"generated_at"`
}

DiagnosticReport contains all evaluation results.

type DiagnosticResult

type DiagnosticResult struct {
	ID             string           `json:"id" yaml:"id"`
	Category       string           `json:"category" yaml:"category"` // CPU, Memory, Disk, Network, DNS, Process, Docker, Kubernetes
	Name           string           `json:"name" yaml:"name"`
	Status         DiagnosticStatus `json:"status" yaml:"status"`
	Severity       Severity         `json:"severity" yaml:"severity"`
	Description    string           `json:"description" yaml:"description"`
	MetricValue    string           `json:"metric_value" yaml:"metric_value"`
	Threshold      string           `json:"threshold,omitempty" yaml:"threshold,omitempty"`
	Recommendation string           `json:"recommendation,omitempty" yaml:"recommendation,omitempty"`
	Timestamp      time.Time        `json:"timestamp" yaml:"timestamp"`
}

DiagnosticResult represents an individual health check evaluation.

type DiagnosticStatus

type DiagnosticStatus string

DiagnosticStatus represents the health check outcome.

const (
	StatusPass    DiagnosticStatus = "PASS"
	StatusWarning DiagnosticStatus = "WARNING"
	StatusFail    DiagnosticStatus = "CRITICAL"
	StatusInfo    DiagnosticStatus = "INFO"
	StatusSkip    DiagnosticStatus = "SKIPPED"
)

type DiskIOCounters

type DiskIOCounters struct {
	Name       string    `json:"name" yaml:"name"`
	ReadBytes  uint64    `json:"read_bytes" yaml:"read_bytes"`
	WriteBytes uint64    `json:"write_bytes" yaml:"write_bytes"`
	ReadCount  uint64    `json:"read_count" yaml:"read_count"`
	WriteCount uint64    `json:"write_count" yaml:"write_count"`
	ReadRate   float64   `json:"read_bytes_sec" yaml:"read_bytes_sec"`   // bytes/sec
	WriteRate  float64   `json:"write_bytes_sec" yaml:"write_bytes_sec"` // bytes/sec
	ReadIOPS   float64   `json:"read_iops" yaml:"read_iops"`             // ops/sec
	WriteIOPS  float64   `json:"write_iops" yaml:"write_iops"`           // ops/sec
	Timestamp  time.Time `json:"timestamp" yaml:"timestamp"`
}

DiskIOCounters represents disk I/O metrics.

type DiskInfo

type DiskInfo struct {
	Partitions  []PartitionInfo  `json:"partitions" yaml:"partitions"`
	IOCounters  []DiskIOCounters `json:"io_counters" yaml:"io_counters"`
	TotalBytes  uint64           `json:"total_bytes" yaml:"total_bytes"`
	UsedBytes   uint64           `json:"used_bytes" yaml:"used_bytes"`
	FreeBytes   uint64           `json:"free_bytes" yaml:"free_bytes"`
	UsedPercent float64          `json:"used_percent" yaml:"used_percent"`
	CollectedAt time.Time        `json:"collected_at" yaml:"collected_at"`
}

DiskInfo represents consolidated disk information.

type DockerContainer

type DockerContainer struct {
	ID           string          `json:"id" yaml:"id"`
	Names        []string        `json:"names" yaml:"names"`
	Image        string          `json:"image" yaml:"image"`
	ImageID      string          `json:"image_id" yaml:"image_id"`
	Command      string          `json:"command" yaml:"command"`
	Created      time.Time       `json:"created" yaml:"created"`
	State        string          `json:"state" yaml:"state"`   // running, exited, paused
	Status       string          `json:"status" yaml:"status"` // "Up 2 hours"
	Ports        []string        `json:"ports,omitempty" yaml:"ports,omitempty"`
	RestartCount int             `json:"restart_count" yaml:"restart_count"`
	Stats        *ContainerStats `json:"stats,omitempty" yaml:"stats,omitempty"`
}

DockerContainer represents a Docker container.

type DockerSummary

type DockerSummary struct {
	Available       bool              `json:"available" yaml:"available"`
	Version         string            `json:"version,omitempty" yaml:"version,omitempty"`
	APIVersion      string            `json:"api_version,omitempty" yaml:"api_version,omitempty"`
	ContainersTotal int               `json:"containers_total" yaml:"containers_total"`
	RunningCount    int               `json:"running_count" yaml:"running_count"`
	PausedCount     int               `json:"paused_count" yaml:"paused_count"`
	StoppedCount    int               `json:"stopped_count" yaml:"stopped_count"`
	ImagesCount     int               `json:"images_count" yaml:"images_count"`
	Containers      []DockerContainer `json:"containers" yaml:"containers"`
	Error           string            `json:"error,omitempty" yaml:"error,omitempty"`
	CollectedAt     time.Time         `json:"collected_at" yaml:"collected_at"`
}

DockerSummary represents overall Docker engine status.

type K8sDeployment

type K8sDeployment struct {
	Namespace         string `json:"namespace" yaml:"namespace"`
	Name              string `json:"name" yaml:"name"`
	ReplicasDesired   int32  `json:"replicas_desired" yaml:"replicas_desired"`
	ReplicasAvailable int32  `json:"replicas_available" yaml:"replicas_available"`
	ReplicasUpdated   int32  `json:"replicas_updated" yaml:"replicas_updated"`
}

K8sDeployment represents a Deployment.

type K8sEvent

type K8sEvent struct {
	Type      string    `json:"type" yaml:"type"` // Normal, Warning
	Reason    string    `json:"reason" yaml:"reason"`
	Message   string    `json:"message" yaml:"message"`
	Object    string    `json:"object" yaml:"object"`
	Count     int32     `json:"count" yaml:"count"`
	Timestamp time.Time `json:"timestamp" yaml:"timestamp"`
}

K8sEvent represents a cluster event.

type K8sNode

type K8sNode struct {
	Name             string            `json:"name" yaml:"name"`
	Status           string            `json:"status" yaml:"status"` // Ready, NotReady
	Roles            []string          `json:"roles" yaml:"roles"`
	Version          string            `json:"version" yaml:"version"`
	OSImage          string            `json:"os_image" yaml:"os_image"`
	KernelVersion    string            `json:"kernel_version" yaml:"kernel_version"`
	ContainerRuntime string            `json:"container_runtime" yaml:"container_runtime"`
	CPUCapacity      string            `json:"cpu_capacity" yaml:"cpu_capacity"`
	MemoryCapacity   string            `json:"memory_capacity" yaml:"memory_capacity"`
	PodsCount        int               `json:"pods_count" yaml:"pods_count"`
	Addresses        map[string]string `json:"addresses" yaml:"addresses"`
}

K8sNode represents a Kubernetes worker/control-plane node.

type K8sPod

type K8sPod struct {
	Namespace     string            `json:"namespace" yaml:"namespace"`
	Name          string            `json:"name" yaml:"name"`
	Status        string            `json:"status" yaml:"status"` // Running, Pending, CrashLoopBackOff, Succeeded, Failed
	IP            string            `json:"ip,omitempty" yaml:"ip,omitempty"`
	NodeName      string            `json:"node_name" yaml:"node_name"`
	RestartsTotal int               `json:"restarts_total" yaml:"restarts_total"`
	Age           time.Duration     `json:"age" yaml:"age"`
	Containers    []string          `json:"containers" yaml:"containers"`
	Labels        map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
}

K8sPod represents a Pod.

type K8sSummary

type K8sSummary struct {
	Available     bool            `json:"available" yaml:"available"`
	ClusterName   string          `json:"cluster_name,omitempty" yaml:"cluster_name,omitempty"`
	ServerVersion string          `json:"server_version,omitempty" yaml:"server_version,omitempty"`
	Nodes         []K8sNode       `json:"nodes" yaml:"nodes"`
	Pods          []K8sPod        `json:"pods" yaml:"pods"`
	Deployments   []K8sDeployment `json:"deployments" yaml:"deployments"`
	RecentEvents  []K8sEvent      `json:"recent_events,omitempty" yaml:"recent_events,omitempty"`
	TotalNodes    int             `json:"total_nodes" yaml:"total_nodes"`
	ReadyNodes    int             `json:"ready_nodes" yaml:"ready_nodes"`
	TotalPods     int             `json:"total_pods" yaml:"total_pods"`
	RunningPods   int             `json:"running_pods" yaml:"running_pods"`
	Error         string          `json:"error,omitempty" yaml:"error,omitempty"`
	CollectedAt   time.Time       `json:"collected_at" yaml:"collected_at"`
}

K8sSummary represents cluster overview.

type LoadAvg

type LoadAvg struct {
	Load1  float64 `json:"load1" yaml:"load1"`
	Load5  float64 `json:"load5" yaml:"load5"`
	Load15 float64 `json:"load15" yaml:"load15"`
}

LoadAvg represents 1, 5, and 15-minute load averages.

type MemoryInfo

type MemoryInfo struct {
	TotalBytes      uint64    `json:"total_bytes" yaml:"total_bytes"`
	UsedBytes       uint64    `json:"used_bytes" yaml:"used_bytes"`
	FreeBytes       uint64    `json:"free_bytes" yaml:"free_bytes"`
	AvailableBytes  uint64    `json:"available_bytes" yaml:"available_bytes"`
	UsedPercent     float64   `json:"used_percent" yaml:"used_percent"`
	CachedBytes     uint64    `json:"cached_bytes" yaml:"cached_bytes"`
	BuffersBytes    uint64    `json:"buffers_bytes" yaml:"buffers_bytes"`
	SwapTotalBytes  uint64    `json:"swap_total_bytes" yaml:"swap_total_bytes"`
	SwapUsedBytes   uint64    `json:"swap_used_bytes" yaml:"swap_used_bytes"`
	SwapFreeBytes   uint64    `json:"swap_free_bytes" yaml:"swap_free_bytes"`
	SwapUsedPercent float64   `json:"swap_used_percent" yaml:"swap_used_percent"`
	CollectedAt     time.Time `json:"collected_at" yaml:"collected_at"`
}

MemoryInfo represents virtual memory and swap statistics.

type NetworkIOInfo

type NetworkIOInfo struct {
	Name         string    `json:"name" yaml:"name"`
	BytesSent    uint64    `json:"bytes_sent" yaml:"bytes_sent"`
	BytesRecv    uint64    `json:"bytes_recv" yaml:"bytes_recv"`
	PacketsSent  uint64    `json:"packets_sent" yaml:"packets_sent"`
	PacketsRecv  uint64    `json:"packets_recv" yaml:"packets_recv"`
	ErrIn        uint64    `json:"err_in" yaml:"err_in"`
	ErrOut       uint64    `json:"err_out" yaml:"err_out"`
	DropIn       uint64    `json:"drop_in" yaml:"drop_in"`
	DropOut      uint64    `json:"drop_out" yaml:"drop_out"`
	TxRate       float64   `json:"tx_bytes_sec" yaml:"tx_bytes_sec"` // bytes/sec
	RxRate       float64   `json:"rx_bytes_sec" yaml:"rx_bytes_sec"` // bytes/sec
	TxPacketsSec float64   `json:"tx_packets_sec" yaml:"tx_packets_sec"`
	RxPacketsSec float64   `json:"rx_packets_sec" yaml:"rx_packets_sec"`
	Timestamp    time.Time `json:"timestamp" yaml:"timestamp"`
}

NetworkIOInfo represents I/O and packet stats for an interface.

type NetworkInfo

type NetworkInfo struct {
	Interfaces     []NetworkInterfaceInfo `json:"interfaces" yaml:"interfaces"`
	IOStats        []NetworkIOInfo        `json:"io_stats" yaml:"io_stats"`
	TotalBytesSent uint64                 `json:"total_bytes_sent" yaml:"total_bytes_sent"`
	TotalBytesRecv uint64                 `json:"total_bytes_recv" yaml:"total_bytes_recv"`
	TotalTxRate    float64                `json:"total_tx_bytes_sec" yaml:"total_tx_bytes_sec"`
	TotalRxRate    float64                `json:"total_rx_bytes_sec" yaml:"total_rx_bytes_sec"`
	Connections    []ConnectionInfo       `json:"connections,omitempty" yaml:"connections,omitempty"`
	CollectedAt    time.Time              `json:"collected_at" yaml:"collected_at"`
}

NetworkInfo represents consolidated network data.

type NetworkInterfaceInfo

type NetworkInterfaceInfo struct {
	Index        int      `json:"index" yaml:"index"`
	MTU          int      `json:"mtu" yaml:"mtu"`
	Name         string   `json:"name" yaml:"name"`
	HardwareAddr string   `json:"hardware_addr" yaml:"hardware_addr"`
	Flags        []string `json:"flags" yaml:"flags"`
	Addrs        []string `json:"addrs" yaml:"addrs"`
	IsUp         bool     `json:"is_up" yaml:"is_up"`
	IsLoopback   bool     `json:"is_loopback" yaml:"is_loopback"`
}

NetworkInterfaceInfo represents a single network interface.

type PartitionInfo

type PartitionInfo struct {
	Device      string  `json:"device" yaml:"device"`
	Mountpoint  string  `json:"mountpoint" yaml:"mountpoint"`
	FSType      string  `json:"fs_type" yaml:"fs_type"`
	Opts        string  `json:"opts,omitempty" yaml:"opts,omitempty"`
	TotalBytes  uint64  `json:"total_bytes" yaml:"total_bytes"`
	UsedBytes   uint64  `json:"used_bytes" yaml:"used_bytes"`
	FreeBytes   uint64  `json:"free_bytes" yaml:"free_bytes"`
	UsedPercent float64 `json:"used_percent" yaml:"used_percent"`
	InodesTotal uint64  `json:"inodes_total,omitempty" yaml:"inodes_total,omitempty"`
	InodesUsed  uint64  `json:"inodes_used,omitempty" yaml:"inodes_used,omitempty"`
	InodesFree  uint64  `json:"inodes_free,omitempty" yaml:"inodes_free,omitempty"`
	InodesPct   float64 `json:"inodes_percent,omitempty" yaml:"inodes_percent,omitempty"`
}

PartitionInfo represents disk partition usage.

type PortInfo

type PortInfo struct {
	Protocol    string    `json:"protocol" yaml:"protocol"` // tcp, tcp6, udp, udp6
	Port        uint32    `json:"port" yaml:"port"`
	BindAddress string    `json:"bind_address" yaml:"bind_address"`
	State       string    `json:"state" yaml:"state"` // LISTEN, etc.
	PID         int32     `json:"pid" yaml:"pid"`
	ProcessName string    `json:"process_name" yaml:"process_name"`
	CollectedAt time.Time `json:"collected_at" yaml:"collected_at"`
}

PortInfo represents an open/listening network port.

type ProcessInfo

type ProcessInfo struct {
	PID           int32          `json:"pid" yaml:"pid"`
	PPID          int32          `json:"ppid" yaml:"ppid"`
	Name          string         `json:"name" yaml:"name"`
	Username      string         `json:"username,omitempty" yaml:"username,omitempty"`
	CPUPercent    float64        `json:"cpu_percent" yaml:"cpu_percent"`
	MemoryPercent float32        `json:"memory_percent" yaml:"memory_percent"`
	MemoryRSS     uint64         `json:"memory_rss_bytes" yaml:"memory_rss_bytes"`
	MemoryVMS     uint64         `json:"memory_vms_bytes" yaml:"memory_vms_bytes"`
	Status        string         `json:"status" yaml:"status"` // Running, Sleeping, Stopped, Zombie
	NumThreads    int32          `json:"num_threads" yaml:"num_threads"`
	CreateTime    time.Time      `json:"create_time" yaml:"create_time"`
	CommandLine   string         `json:"command_line,omitempty" yaml:"command_line,omitempty"`
	ExePath       string         `json:"exe_path,omitempty" yaml:"exe_path,omitempty"`
	Nice          int32          `json:"nice,omitempty" yaml:"nice,omitempty"`
	ReadBytesSec  float64        `json:"read_bytes_sec,omitempty" yaml:"read_bytes_sec,omitempty"`
	WriteBytesSec float64        `json:"write_bytes_sec,omitempty" yaml:"write_bytes_sec,omitempty"`
	Children      []*ProcessInfo `json:"children,omitempty" yaml:"children,omitempty"`
}

ProcessInfo represents a single operating system process.

type ProcessSummary

type ProcessSummary struct {
	TotalCount    int           `json:"total_count" yaml:"total_count"`
	RunningCount  int           `json:"running_count" yaml:"running_count"`
	SleepingCount int           `json:"sleeping_count" yaml:"sleeping_count"`
	StoppedCount  int           `json:"stopped_count" yaml:"stopped_count"`
	ZombieCount   int           `json:"zombie_count" yaml:"zombie_count"`
	Processes     []ProcessInfo `json:"processes" yaml:"processes"`
	CollectedAt   time.Time     `json:"collected_at" yaml:"collected_at"`
}

ProcessSummary provides overall process statistics.

type ReportData

type ReportData struct {
	Title        string            `json:"title" yaml:"title"`
	GeneratedAt  time.Time         `json:"generated_at" yaml:"generated_at"`
	Host         SystemInfo        `json:"host" yaml:"host"`
	CPU          CPUInfo           `json:"cpu" yaml:"cpu"`
	Memory       MemoryInfo        `json:"memory" yaml:"memory"`
	Disk         DiskInfo          `json:"disk" yaml:"disk"`
	Network      NetworkInfo       `json:"network" yaml:"network"`
	TopProcesses []ProcessInfo     `json:"top_processes" yaml:"top_processes"`
	Diagnostics  *DiagnosticReport `json:"diagnostics,omitempty" yaml:"diagnostics,omitempty"`
	ActiveAlerts []AlertEvent      `json:"active_alerts,omitempty" yaml:"active_alerts,omitempty"`
	Anomalies    *AnomalyReport    `json:"anomalies,omitempty" yaml:"anomalies,omitempty"`
	Docker       *DockerSummary    `json:"docker,omitempty" yaml:"docker,omitempty"`
	Kubernetes   *K8sSummary       `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"`
}

ReportData consolidates all system snapshot metrics for reporting.

type ServiceInfo

type ServiceInfo struct {
	Name        string       `json:"name" yaml:"name"`
	DisplayName string       `json:"display_name,omitempty" yaml:"display_name,omitempty"`
	Status      ServiceState `json:"status" yaml:"status"`
	PID         int32        `json:"pid,omitempty" yaml:"pid,omitempty"`
	StartType   string       `json:"start_type,omitempty" yaml:"start_type,omitempty"` // Auto, Manual, Disabled
	Description string       `json:"description,omitempty" yaml:"description,omitempty"`
	Manager     string       `json:"manager" yaml:"manager"` // windows, systemd, launchd
	CollectedAt time.Time    `json:"collected_at" yaml:"collected_at"`
}

ServiceInfo represents a system service/daemon (systemd, Windows service, launchd).

type ServiceState

type ServiceState string

ServiceState defines the status of a service.

const (
	ServiceStateRunning ServiceState = "running"
	ServiceStateStopped ServiceState = "stopped"
	ServiceStatePaused  ServiceState = "paused"
	ServiceStateUnknown ServiceState = "unknown"
)

type Severity

type Severity string

Severity indicates urgency.

const (
	SeverityInfo     Severity = "INFO"
	SeverityWarning  Severity = "WARNING"
	SeverityCritical Severity = "CRITICAL"
)

type SystemInfo

type SystemInfo struct {
	Hostname        string        `json:"hostname" yaml:"hostname"`
	OS              string        `json:"os" yaml:"os"`
	Platform        string        `json:"platform" yaml:"platform"`
	PlatformFamily  string        `json:"platform_family" yaml:"platform_family"`
	PlatformVersion string        `json:"platform_version" yaml:"platform_version"`
	KernelVersion   string        `json:"kernel_version" yaml:"kernel_version"`
	KernelArch      string        `json:"kernel_arch" yaml:"kernel_arch"`
	Uptime          time.Duration `json:"uptime" yaml:"uptime"`
	UptimeFormatted string        `json:"uptime_formatted" yaml:"uptime_formatted"`
	BootTime        time.Time     `json:"boot_time" yaml:"boot_time"`
	ProcsCount      uint64        `json:"procs_count" yaml:"procs_count"`
	HostID          string        `json:"host_id" yaml:"host_id"`
	CollectedAt     time.Time     `json:"collected_at" yaml:"collected_at"`
}

SystemInfo represents general host information.

type SystemSnapshot

type SystemSnapshot struct {
	Timestamp  time.Time       `json:"timestamp" yaml:"timestamp"`
	System     *SystemInfo     `json:"system,omitempty" yaml:"system,omitempty"`
	CPU        *CPUInfo        `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory     *MemoryInfo     `json:"memory,omitempty" yaml:"memory,omitempty"`
	Disk       *DiskInfo       `json:"disk,omitempty" yaml:"disk,omitempty"`
	Network    *NetworkInfo    `json:"network,omitempty" yaml:"network,omitempty"`
	Processes  *ProcessSummary `json:"processes,omitempty" yaml:"processes,omitempty"`
	Services   []ServiceInfo   `json:"services,omitempty" yaml:"services,omitempty"`
	Ports      []PortInfo      `json:"ports,omitempty" yaml:"ports,omitempty"`
	Docker     *DockerSummary  `json:"docker,omitempty" yaml:"docker,omitempty"`
	Kubernetes *K8sSummary     `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"`
}

SystemSnapshot represents a complete point-in-time state of all system metrics.

Jump to

Keyboard shortcuts

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