tools

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package tools provides MCP tool implementations for system inspection, including CPU, memory, disk, network, Docker, GPU, and other utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractField

func ExtractField(output, prefix string) string

func HumanSize

func HumanSize(bytes int64) string

func LogToolCall

func LogToolCall(
	ctx context.Context,
	tool string,
	dur time.Duration,
	errs int,
)

func ParseProcessField

func ParseProcessField(s string) string

func RegisterResources

func RegisterResources(server *mcp.Server)

func RegisterTools

func RegisterTools(server *mcp.Server)

func SplitHostPort

func SplitHostPort(s string) (string, string, bool)

func WithToolTimeout

func WithToolTimeout(
	ctx context.Context,
	name string,
	fallback time.Duration,
) (context.Context, context.CancelFunc)

Types

type AuditLogEntry added in v0.2.10

type AuditLogEntry struct {
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
	Message   string `json:"message"`
}

type AuditLogsOutput added in v0.2.10

type AuditLogsOutput struct {
	Entries []AuditLogEntry `json:"entries"`
	OutputErrors
}

func GatherAuditLogs added in v0.2.10

func GatherAuditLogs(
	ctx context.Context,
	lines int,
	source string,
) (*AuditLogsOutput, error)

func HandleGetAuditLogs added in v0.2.10

func HandleGetAuditLogs(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetAuditLogsInput,
) (*mcp.CallToolResult, *AuditLogsOutput, error)

type AvailableUpdate

type AvailableUpdate struct {
	Name    string `json:"name"`
	Current string `json:"current,omitempty"`
	New     string `json:"new,omitempty"`
}

type BlockDevice added in v0.2.9

type BlockDevice struct {
	Name       string `json:"name"`
	MajorMinor string `json:"major_minor"`
	Size       string `json:"size"`
	Type       string `json:"type"`
	FSType     string `json:"fs_type,omitempty"`
	MountPoint string `json:"mount_point,omitempty"`
	Model      string `json:"model,omitempty"`
	Vendor     string `json:"vendor,omitempty"`
	RO         bool   `json:"ro"`
}

type BlockDevicesOutput added in v0.2.9

type BlockDevicesOutput struct {
	Devices []BlockDevice `json:"devices"`
	OutputErrors
}

func GatherBlockDevices added in v0.2.9

func GatherBlockDevices(ctx context.Context) (*BlockDevicesOutput, error)

func HandleGetBlockDevices added in v0.2.9

func HandleGetBlockDevices(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *BlockDevicesOutput, error)

type BootBlameEntry added in v0.2.13

type BootBlameEntry struct {
	Unit        string  `json:"unit"`
	Time        string  `json:"time"`
	TimeSeconds float64 `json:"time_seconds"`
}

type BootBlameOutput added in v0.2.13

type BootBlameOutput struct {
	Entries []BootBlameEntry `json:"entries"`
	OutputErrors
}

func GatherBootBlame added in v0.2.13

func GatherBootBlame(ctx context.Context) (*BootBlameOutput, error)

func HandleGetBootBlame added in v0.2.13

func HandleGetBootBlame(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *BootBlameOutput, error)
type BootChainLink struct {
	Unit          string  `json:"unit"`
	Depth         int     `json:"depth"`
	ActiveTime    string  `json:"active_time,omitempty"`
	ActiveSeconds float64 `json:"active_seconds,omitempty"`
	StartTime     string  `json:"start_time,omitempty"`
	StartSeconds  float64 `json:"start_seconds,omitempty"`
}

type BootCriticalChainOutput added in v0.2.13

type BootCriticalChainOutput struct {
	Target string          `json:"target"`
	Chain  []BootChainLink `json:"chain"`
	OutputErrors
}

func GatherBootCriticalChain added in v0.2.13

func GatherBootCriticalChain(
	ctx context.Context, unit string,
) (*BootCriticalChainOutput, error)

func HandleGetBootCriticalChain added in v0.2.13

type BootPhase added in v0.2.13

type BootPhase struct {
	Name    string  `json:"name"`
	Time    string  `json:"time"`
	Seconds float64 `json:"seconds"`
}

type BootTimeOutput added in v0.2.13

type BootTimeOutput struct {
	Phases               []BootPhase `json:"phases"`
	Total                string      `json:"total,omitempty"`
	TotalSeconds         float64     `json:"total_seconds,omitempty"`
	Target               string      `json:"target,omitempty"`
	TargetReachedTime    string      `json:"target_reached_time,omitempty"`
	TargetReachedSeconds float64     `json:"target_reached_seconds,omitempty"`
	OutputErrors
}

func GatherBootTime added in v0.2.13

func GatherBootTime(ctx context.Context) (*BootTimeOutput, error)

func HandleGetBootTime added in v0.2.13

func HandleGetBootTime(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *BootTimeOutput, error)

type BusDevice added in v0.1.5

type BusDevice struct {
	Bus    string `json:"bus"`
	Slot   string `json:"slot,omitempty"`
	Class  string `json:"class,omitempty"`
	Vendor string `json:"vendor,omitempty"`
	Device string `json:"device"`
}

type CPUDetails

type CPUDetails struct {
	ModelName string  `json:"model_name"`
	CoreCount int32   `json:"core_count"`
	MHz       float64 `json:"mhz"`
}

type CPUInfoOutput

type CPUInfoOutput struct {
	UsagePercent      float64      `json:"usage_percent"`
	PhysicalCoreCount int32        `json:"physical_core_count"`
	Cores             []CPUDetails `json:"cores"`
	OutputErrors
}

func GatherCPUInfo

func GatherCPUInfo(ctx context.Context) (*CPUInfoOutput, error)

type CPUTemperatureOutput

type CPUTemperatureOutput struct {
	Temperatures []TemperatureStat `json:"temperatures"`
	Message      string            `json:"message,omitempty"`
	OutputErrors
}

func GatherCPUTemperature

func GatherCPUTemperature(ctx context.Context) (*CPUTemperatureOutput, error)

type CheckUpdatesOutput

type CheckUpdatesOutput struct {
	Updates []AvailableUpdate `json:"updates"`
	Total   int               `json:"total"`
	OutputErrors
}

func GatherCheckUpdates

func GatherCheckUpdates(ctx context.Context) (*CheckUpdatesOutput, error)

type ConnectionGroup added in v0.2.3

type ConnectionGroup struct {
	PID         int32               `json:"pid"`
	ProcessName string              `json:"process_name"`
	Connections []NetworkConnection `json:"connections"`
}

type CronEntry added in v0.2.9

type CronEntry struct {
	Schedule string `json:"schedule,omitempty"`
	Command  string `json:"command"`
}

type CronJob added in v0.1.8

type CronJob struct {
	Schedule string `json:"schedule"`
	Command  string `json:"command"`
}

type CronJobsOutput added in v0.2.9

type CronJobsOutput struct {
	SystemCrontab []CronEntry `json:"system_crontab"`
	DailyJobs     []string    `json:"daily_jobs"`
	WeeklyJobs    []string    `json:"weekly_jobs"`
	HourlyJobs    []string    `json:"hourly_jobs"`
	OutputErrors
}

func GatherCronJobs added in v0.2.9

func GatherCronJobs(ctx context.Context) (*CronJobsOutput, error)

func HandleGetCronJobs added in v0.2.9

func HandleGetCronJobs(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *CronJobsOutput, error)

type DesktopSessionOutput added in v0.1.8

type DesktopSessionOutput struct {
	SessionType    string `json:"session_type"`
	CurrentDesktop string `json:"current_desktop"`
	RuntimeDir     string `json:"runtime_dir"`
	Display        string `json:"display"`
	WaylandDisplay string `json:"wayland_display"`
	OutputErrors
}

func GatherDesktopSessionInfo added in v0.1.8

func GatherDesktopSessionInfo(
	ctx context.Context,
) (*DesktopSessionOutput, error)

func HandleGetDesktopSessionInfo added in v0.1.8

func HandleGetDesktopSessionInfo(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *DesktopSessionOutput, error)

type DiskIOMetric added in v0.2.9

type DiskIOMetric struct {
	Device          string `json:"device"`
	ReadsCompleted  uint64 `json:"reads_completed"`
	SectorsRead     uint64 `json:"sectors_read"`
	WritesCompleted uint64 `json:"writes_completed"`
	SectorsWritten  uint64 `json:"sectors_written"`
	IOsInProgress   uint64 `json:"ios_in_progress"`
	ReadTimeMs      uint64 `json:"read_time_ms"`
	WriteTimeMs     uint64 `json:"write_time_ms"`
}

type DiskIOMetricsOutput added in v0.2.9

type DiskIOMetricsOutput struct {
	Metrics []DiskIOMetric `json:"metrics"`
	OutputErrors
}

func GatherDiskIOMetrics added in v0.2.9

func GatherDiskIOMetrics(
	ctx context.Context,
) (*DiskIOMetricsOutput, error)

func HandleGetDiskIOMetrics added in v0.2.9

func HandleGetDiskIOMetrics(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *DiskIOMetricsOutput, error)

type DiskInfoOutput

type DiskInfoOutput struct {
	Partitions []DiskUsageStat `json:"partitions"`
	OutputErrors
}

func GatherDiskInfo

func GatherDiskInfo(
	ctx context.Context,
	mountPoint string,
	threshold float64,
) (*DiskInfoOutput, error)

type DiskUsageStat

type DiskUsageStat struct {
	MountPoint  string  `json:"mount_point"`
	Filesystem  string  `json:"filesystem"`
	Device      string  `json:"device"`
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	Free        uint64  `json:"free"`
	UsedPercent float64 `json:"used_percent"`
}

type DockerContainer

type DockerContainer struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Image  string `json:"image"`
	Status string `json:"status"`
}

func ListDockerContainers

func ListDockerContainers(ctx context.Context) ([]DockerContainer, error)

type DockerContainerDetail

type DockerContainerDetail struct {
	ID      string                 `json:"id"`
	Name    string                 `json:"name"`
	Image   string                 `json:"image"`
	Created string                 `json:"created"`
	State   map[string]any         `json:"state"`
	Status  string                 `json:"status"`
	Path    string                 `json:"path"`
	Args    []string               `json:"args"`
	Env     []string               `json:"env"`
	Mounts  []DockerContainerMount `json:"mounts"`
	Network map[string]any         `json:"network"`
	Ports   map[string]any         `json:"ports"`
}

type DockerContainerDetailOutput

type DockerContainerDetailOutput struct {
	Container DockerContainerDetail `json:"container"`
	OutputErrors
}

func GatherContainerDetail

func GatherContainerDetail(
	ctx context.Context,
	containerID string,
) (*DockerContainerDetailOutput, error)

type DockerContainerDiffOutput

type DockerContainerDiffOutput struct {
	Changes []DockerFileChange `json:"changes"`
	OutputErrors
}

func GatherContainerDiff

func GatherContainerDiff(
	ctx context.Context,
	containerID string,
) (*DockerContainerDiffOutput, error)

type DockerContainerLogsOutput

type DockerContainerLogsOutput struct {
	Logs []string `json:"logs"`
	OutputErrors
}

func GatherContainerLogs

func GatherContainerLogs(
	ctx context.Context,
	containerID string,
	tail int,
	timestamps bool,
) (*DockerContainerLogsOutput, error)

type DockerContainerMount

type DockerContainerMount struct {
	Type        string `json:"type"`
	Source      string `json:"source"`
	Destination string `json:"destination"`
	Mode        string `json:"mode"`
	RW          bool   `json:"rw"`
}

type DockerContainerStatEntry added in v0.2.0

type DockerContainerStatEntry struct {
	ID            string                       `json:"id"`
	Name          string                       `json:"name"`
	CPUPercent    float64                      `json:"cpu_percent"`
	MemoryUsage   uint64                       `json:"memory_usage"`
	MemoryLimit   uint64                       `json:"memory_limit"`
	MemoryPercent float64                      `json:"memory_percent"`
	PIDs          uint64                       `json:"pids"`
	Network       map[string]map[string]uint64 `json:"network,omitempty"`
	BlockRead     uint64                       `json:"block_read"`
	BlockWrite    uint64                       `json:"block_write"`
	Error         string                       `json:"error,omitempty"`
}

type DockerContainerStats

type DockerContainerStats struct {
	CPUPercent    float64                      `json:"cpu_percent"`
	MemoryUsage   uint64                       `json:"memory_usage"`
	MemoryLimit   uint64                       `json:"memory_limit"`
	MemoryPercent float64                      `json:"memory_percent"`
	PIDs          uint64                       `json:"pids"`
	Network       map[string]map[string]uint64 `json:"network,omitempty"`
	BlockRead     uint64                       `json:"block_read"`
	BlockWrite    uint64                       `json:"block_write"`
}

type DockerContainerStatsOutput

type DockerContainerStatsOutput struct {
	Containers []DockerContainerStatEntry `json:"containers"`
	OutputErrors
}

func GatherContainerStats

func GatherContainerStats(
	ctx context.Context,
	containerID string,
) (*DockerContainerStatsOutput, error)

type DockerContainerTopOutput

type DockerContainerTopOutput struct {
	Titles    []string   `json:"titles"`
	Processes [][]string `json:"processes"`
	OutputErrors
}

func GatherContainerTop

func GatherContainerTop(
	ctx context.Context,
	containerID string,
	args []string,
) (*DockerContainerTopOutput, error)

type DockerDiskUsageCategory

type DockerDiskUsageCategory struct {
	ActiveCount int64  `json:"active_count"`
	TotalCount  int64  `json:"total_count"`
	Reclaimable string `json:"reclaimable"`
	TotalSize   string `json:"total_size"`
}

type DockerDiskUsageOutput

type DockerDiskUsageOutput struct {
	Containers DockerDiskUsageCategory `json:"containers"`
	Images     DockerDiskUsageCategory `json:"images"`
	Volumes    DockerDiskUsageCategory `json:"volumes"`
	BuildCache DockerDiskUsageCategory `json:"build_cache"`
	OutputErrors
}

func GatherDockerDiskUsage

func GatherDockerDiskUsage(
	ctx context.Context,
) (*DockerDiskUsageOutput, error)

type DockerFileChange

type DockerFileChange struct {
	Kind string `json:"kind"`
	Path string `json:"path"`
}

type DockerImage

type DockerImage struct {
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
	ID         string `json:"id"`
	Size       string `json:"size"`
}

func ListDockerImages

func ListDockerImages(ctx context.Context) ([]DockerImage, error)

type DockerImageDetail

type DockerImageDetail struct {
	ID           string            `json:"id"`
	RepoTags     []string          `json:"repo_tags"`
	RepoDigests  []string          `json:"repo_digests"`
	Created      string            `json:"created"`
	Author       string            `json:"author"`
	Architecture string            `json:"architecture"`
	OS           string            `json:"os"`
	Size         string            `json:"size"`
	Entrypoint   []string          `json:"entrypoint,omitempty"`
	Cmd          []string          `json:"cmd,omitempty"`
	Env          []string          `json:"env,omitempty"`
	WorkingDir   string            `json:"working_dir,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	Layers       []string          `json:"layers,omitempty"`
}

type DockerImageDetailOutput

type DockerImageDetailOutput struct {
	Image DockerImageDetail `json:"image"`
	OutputErrors
}

func GatherImageDetail

func GatherImageDetail(
	ctx context.Context,
	imageID string,
) (*DockerImageDetailOutput, error)

type DockerImageHistoryOutput

type DockerImageHistoryOutput struct {
	Layers []DockerImageLayer `json:"layers"`
	OutputErrors
}

func GatherImageHistory

func GatherImageHistory(
	ctx context.Context,
	imageID string,
) (*DockerImageHistoryOutput, error)

type DockerImageLayer

type DockerImageLayer struct {
	ID        string   `json:"id"`
	Created   int64    `json:"created"`
	CreatedBy string   `json:"created_by"`
	Size      string   `json:"size"`
	Tags      []string `json:"tags,omitempty"`
	Comment   string   `json:"comment,omitempty"`
}

type DockerInfoOutput

type DockerInfoOutput struct {
	Containers []DockerContainer `json:"containers"`
	Images     []DockerImage     `json:"images"`
	OutputErrors
}

func GatherDockerInfo

func GatherDockerInfo(ctx context.Context) (*DockerInfoOutput, error)

type DockerNetworkSummary

type DockerNetworkSummary struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Driver     string            `json:"driver"`
	Scope      string            `json:"scope"`
	Attachable bool              `json:"attachable"`
	Internal   bool              `json:"internal"`
	Ingress    bool              `json:"ingress"`
	IPv6       bool              `json:"ipv6"`
	Labels     map[string]string `json:"labels,omitempty"`
}

type DockerNetworksOutput

type DockerNetworksOutput struct {
	Networks []DockerNetworkSummary `json:"networks"`
	OutputErrors
}

func GatherDockerNetworks

func GatherDockerNetworks(ctx context.Context) (*DockerNetworksOutput, error)

type DockerStatsAllOutput added in v0.2.0

type DockerStatsAllOutput struct {
	Containers []DockerContainerStatEntry `json:"containers"`
	OutputErrors
}

func GatherDockerStatsAll added in v0.2.0

func GatherDockerStatsAll(
	ctx context.Context,
	containers []string,
) (*DockerStatsAllOutput, error)

func HandleGetDockerStatsAll added in v0.2.0

func HandleGetDockerStatsAll(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetDockerStatsAllInput,
) (*mcp.CallToolResult, *DockerStatsAllOutput, error)

type DockerSystemInfoOutput

type DockerSystemInfoOutput struct {
	Info DockerSystemInfoSummary `json:"info"`
	OutputErrors
}

func GatherDockerSystemInfo

func GatherDockerSystemInfo(
	ctx context.Context,
) (*DockerSystemInfoOutput, error)

type DockerSystemInfoSummary

type DockerSystemInfoSummary struct {
	ID                string         `json:"id"`
	ServerVersion     string         `json:"server_version"`
	Architecture      string         `json:"architecture"`
	OSType            string         `json:"os_type"`
	OperatingSystem   string         `json:"operating_system"`
	KernelVersion     string         `json:"kernel_version"`
	NCPU              int            `json:"ncpu"`
	MemTotal          string         `json:"mem_total"`
	Driver            string         `json:"driver"`
	LoggingDriver     string         `json:"logging_driver"`
	CgroupDriver      string         `json:"cgroup_driver"`
	CgroupVersion     string         `json:"cgroup_version"`
	DefaultRuntime    string         `json:"default_runtime"`
	Runtimes          []string       `json:"runtimes,omitempty"`
	ContainersTotal   int            `json:"containers_total"`
	ContainersRunning int            `json:"containers_running"`
	ContainersPaused  int            `json:"containers_paused"`
	ContainersStopped int            `json:"containers_stopped"`
	ImagesTotal       int            `json:"images_total"`
	DockerRootDir     string         `json:"docker_root_dir"`
	SecurityOptions   []string       `json:"security_options,omitempty"`
	Swarm             map[string]any `json:"swarm,omitempty"`
}

type DockerSystemSnapshotOutput added in v0.2.0

type DockerSystemSnapshotOutput struct {
	Info      DockerInfoOutput      `json:"info"`
	Stats     DockerStatsAllOutput  `json:"stats"`
	DiskUsage DockerDiskUsageOutput `json:"disk_usage"`
	OutputErrors
}

func HandleGetDockerSystemSnapshot added in v0.2.0

func HandleGetDockerSystemSnapshot(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *DockerSystemSnapshotOutput, error)

type DockerVolumeSummary

type DockerVolumeSummary struct {
	Name       string            `json:"name"`
	Driver     string            `json:"driver"`
	Mountpoint string            `json:"mountpoint"`
	Scope      string            `json:"scope"`
	CreatedAt  string            `json:"created_at"`
	Size       string            `json:"size,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
}

type DockerVolumesOutput

type DockerVolumesOutput struct {
	Volumes []DockerVolumeSummary `json:"volumes"`
	OutputErrors
}

func GatherDockerVolumes

func GatherDockerVolumes(ctx context.Context) (*DockerVolumesOutput, error)

type EnvironmentVariable added in v0.1.5

type EnvironmentVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type EnvironmentVariablesOutput added in v0.1.5

type EnvironmentVariablesOutput struct {
	Variables []EnvironmentVariable `json:"variables"`
	Count     int                   `json:"count"`
	OutputErrors
}

func GatherEnvironmentVariables added in v0.1.5

func GatherEnvironmentVariables(
	ctx context.Context,
	search string,
) (*EnvironmentVariablesOutput, error)

func HandleGetEnvironmentVariables added in v0.1.5

type FailedLoginEntry

type FailedLoginEntry struct {
	Username  string `json:"username"`
	Terminal  string `json:"terminal"`
	Source    string `json:"source"`
	Timestamp string `json:"timestamp"`
}

func ParseJournalctlFailedLogins

func ParseJournalctlFailedLogins(output string) []FailedLoginEntry

func ParseLastbOutput

func ParseLastbOutput(output string) []FailedLoginEntry

type FailedLoginsOutput

type FailedLoginsOutput struct {
	Entries []FailedLoginEntry  `json:"entries"`
	Summary FailedLoginsSummary `json:"summary"`
	OutputErrors
}

func GatherFailedLogins

func GatherFailedLogins(
	ctx context.Context, lines int,
) (*FailedLoginsOutput, error)

func GatherFailedLoginsJournalctl

func GatherFailedLoginsJournalctl(
	ctx context.Context, lines int,
) (*FailedLoginsOutput, error)

type FailedLoginsSummary added in v0.2.7

type FailedLoginsSummary struct {
	TotalAttempts   int `json:"total_attempts"`
	UniqueUsernames int `json:"unique_usernames"`
	UniqueSources   int `json:"unique_sources"`
}

type FileLock added in v0.2.10

type FileLock struct {
	LockType string `json:"lock_type"`
	Access   string `json:"access"`
	PID      int32  `json:"pid"`
	Start    int64  `json:"start"`
	End      int64  `json:"end"`
	Path     string `json:"path"`
}

type FileLocksOutput added in v0.2.10

type FileLocksOutput struct {
	Locks []FileLock `json:"locks"`
	OutputErrors
}

func GatherFileLocks added in v0.2.10

func GatherFileLocks() (*FileLocksOutput, error)

func HandleGetFileLocks added in v0.2.10

func HandleGetFileLocks(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetFileLocksInput,
) (*mcp.CallToolResult, *FileLocksOutput, error)

type FilesystemInfo added in v0.2.9

type FilesystemInfo struct {
	Name  string `json:"name"`
	Nodev bool   `json:"nodev"`
}

type FirewallInfo added in v0.2.9

type FirewallInfo struct {
	IptablesOutput string `json:"iptables_output,omitempty"`
	NftablesOutput string `json:"nftables_output,omitempty"`
	UFWStatus      string `json:"ufw_status,omitempty"`
	Active         bool   `json:"active"`
}

type GPUDevice

type GPUDevice struct {
	Index         int     `json:"index"`
	Name          string  `json:"name"`
	UsagePercent  float64 `json:"usage_percent"`
	MemoryUsedMB  int64   `json:"memory_used_mb"`
	MemoryTotalMB int64   `json:"memory_total_mb"`
	TemperatureC  int64   `json:"temperature_c"`
	PowerDrawW    float64 `json:"power_draw_w"`
}

type GPUInfoOutput

type GPUInfoOutput struct {
	Vendor string      `json:"vendor"`
	GPUs   []GPUDevice `json:"gpus"`
	OutputErrors
}

func GatherAMDGPU

func GatherAMDGPU(ctx context.Context) (*GPUInfoOutput, error)

func GatherGPUInfo

func GatherGPUInfo(ctx context.Context) (*GPUInfoOutput, error)

func GatherNvidiaGPU

func GatherNvidiaGPU(ctx context.Context) (*GPUInfoOutput, error)

type GetAuditLogsInput added in v0.2.10

type GetAuditLogsInput struct {
	Lines  int    `json:"lines,omitempty"  jsonschema:"number of recent entries (default: 50)"`
	Source string `json:"source,omitempty" jsonschema:"audit source: 'journalctl', 'audit.log', or 'auto' (default: auto)"`
}

type GetBootCriticalChainInput added in v0.2.13

type GetBootCriticalChainInput struct {
	Unit string `json:"unit,omitempty" jsonschema:"optional unit name to start the chain from (e.g. 'graphical.target')"`
}

type GetDiskInfoInput

type GetDiskInfoInput struct {
	MountPoint string  `json:"mount_point,omitempty" jsonschema:"optional mount point filter"`
	Threshold  float64 `json:"threshold,omitempty"   jsonschema:"optional threshold filter (e.g. 80 means only partitions >=80% used)"`
}

type GetDockerContainerDetailInput

type GetDockerContainerDetailInput struct {
	ContainerID string `json:"container_id" jsonschema:"container name or ID"`
}

type GetDockerContainerDiffInput

type GetDockerContainerDiffInput struct {
	ContainerID string `json:"container_id" jsonschema:"container name or ID"`
}

type GetDockerContainerLogsInput

type GetDockerContainerLogsInput struct {
	ContainerID string `json:"container_id"         jsonschema:"container name or ID"`
	Tail        int    `json:"tail,omitempty"       jsonschema:"number of lines to tail (default: 100, max: 10000)"`
	Timestamps  bool   `json:"timestamps,omitempty" jsonschema:"include timestamps (default: false)"`
}

type GetDockerContainerStatsInput

type GetDockerContainerStatsInput struct {
	ContainerIDs string `json:"container_ids" jsonschema:"container name(s) or ID(s), comma-separated, or 'all' for all running containers"`
}

type GetDockerContainerTopInput

type GetDockerContainerTopInput struct {
	ContainerID string   `json:"container_id"   jsonschema:"container name or ID"`
	Args        []string `json:"args,omitempty" jsonschema:"optional arguments to ps (e.g. aux)"`
}

type GetDockerImageDetailInput

type GetDockerImageDetailInput struct {
	ImageID string `json:"image_id" jsonschema:"image name or ID"`
}

type GetDockerImageHistoryInput

type GetDockerImageHistoryInput struct {
	ImageID string `json:"image_id" jsonschema:"image name or ID"`
}

type GetDockerStatsAllInput added in v0.2.0

type GetDockerStatsAllInput struct {
	Containers []string `json:"containers,omitempty" jsonschema:"optional list of container names or IDs to filter"`
}

type GetEnvironmentVariablesInput added in v0.1.5

type GetEnvironmentVariablesInput struct {
	Search string `json:"search,omitempty" jsonschema:"optional search string to filter by name (matches prefix or substring, case-insensitive)"`
}

type GetFailedLoginsInput

type GetFailedLoginsInput struct {
	Lines int `json:"lines,omitempty" jsonschema:"number of recent entries (default: 20)"`
}

type GetFileLocksInput added in v0.2.10

type GetFileLocksInput struct{}

type GetHardwareBusInfoInput added in v0.1.5

type GetHardwareBusInfoInput struct {
	Search string `json:"search,omitempty" jsonschema:"optional search string to filter devices by any field (bus, slot, class, vendor, device)"`
}

type GetIPInfoInput added in v0.2.4

type GetIPInfoInput struct {
	IP string `json:"ip,omitempty" jsonschema:"optional IP address to lookup (defaults to your public IP)"`
}

type GetInodeUsageInput

type GetInodeUsageInput struct {
	MountPoint string `json:"mount_point,omitempty" jsonschema:"optional mount point filter"`
}

type GetInstalledPackagesInput

type GetInstalledPackagesInput struct {
	Name string `json:"name,omitempty" jsonschema:"optional package name filter"`
}

type GetJournalLogsInput

type GetJournalLogsInput struct {
	Unit     string `json:"unit,omitempty"     jsonschema:"optional systemd unit name (e.g. 'nginx.service')"`
	Priority string `json:"priority,omitempty" jsonschema:"optional log priority: emerg,alert,crit,err,warning,notice,info,debug"`
	Since    string `json:"since,omitempty"    jsonschema:"optional start time (e.g. '1 hour ago', '2024-07-03')"`
	Until    string `json:"until,omitempty"    jsonschema:"optional end time"`
	Lines    int    `json:"lines,omitempty"    jsonschema:"number of recent lines (default: 50)"`
	User     bool   `json:"user,omitempty"     jsonschema:"query user-level journal (default: false)"`
}

type GetLargestFilesInput

type GetLargestFilesInput struct {
	Path  string `json:"path,omitempty"  jsonschema:"directory to scan (default: current dir)"`
	Limit int    `json:"limit,omitempty" jsonschema:"max results (default: 10, max: 100)"`
}

type GetListeningPortsInput

type GetListeningPortsInput struct {
	Protocol string `json:"protocol,omitempty" jsonschema:"optional protocol filter: tcp, udp"`
}

type GetManPageInput added in v0.1.2

type GetManPageInput struct {
	Command           string `json:"command"                       jsonschema:"command name to get the man page for"`
	MaxLines          int    `json:"max_lines,omitempty"           jsonschema:"maximum number of lines to return (default: 500, max: 10000)"`
	CleanSpecialChars bool   `json:"clean_special_chars,omitempty" jsonschema:"clean backspace formatting characters (default: true)"`
	Search            string `json:"search,omitempty"              jsonschema:"search term to grep for in the man page (case-insensitive)"`
	ContextLines      int    `` /* 137-byte string literal not displayed */
	Offset            int    `json:"offset,omitempty"              jsonschema:"line offset to start reading from (0-based)"`
}

type GetMountOptionsInput

type GetMountOptionsInput struct {
	MountPoint string `json:"mount_point,omitempty" jsonschema:"optional mount point filter (e.g. '/')"`
}

type GetNetworkConnectionsInput added in v0.2.3

type GetNetworkConnectionsInput struct {
	Status           string `json:"status,omitempty"            jsonschema:"optional status filter (e.g. ESTABLISHED, LISTEN, TIME_WAIT)"`
	Type             string `json:"type,omitempty"              jsonschema:"optional type filter: tcp, udp"`
	ResolveHostnames bool   `json:"resolve_hostnames,omitempty" jsonschema:"optional: resolve remote hostnames via reverse DNS (default: false)"`
	Grouped          bool   `json:"grouped,omitempty"           jsonschema:"optional: group connections by PID (default: false)"`
	MaxConnections   int    `json:"max_connections,omitempty"   jsonschema:"optional: limit results (max: 200)"`
}

type GetProcDiagnosticsInput added in v0.2.9

type GetProcDiagnosticsInput struct {
	Sections string `` /* 141-byte string literal not displayed */
}

type GetProcessFDsInput added in v0.2.1

type GetProcessFDsInput struct {
	PID int32 `json:"pid" jsonschema:"process ID to list open file descriptors for"`
}

type GetProcessInfoInput

type GetProcessInfoInput struct {
	SortBy string `json:"sort_by,omitempty" jsonschema:"sort by 'cpu', 'memory', or 'both' (default: cpu)"`
	Limit  int    `json:"limit,omitempty"   jsonschema:"max results (default: 10, max: 100)"`
}

type GetProcessTreeInput added in v0.2.14

type GetProcessTreeInput struct {
	PID *int32 `json:"pid,omitempty" jsonschema:"optional PID to show subtree from (omit for full tree)"`
}

type GetSMARTHealthInput added in v0.2.9

type GetSMARTHealthInput struct {
	Device string `json:"device,omitempty" jsonschema:"optional device name (e.g. sda, nvme0n1). If empty, checks all devices"`
}

type GetServiceStatusInput

type GetServiceStatusInput struct {
	Name string `json:"name"           jsonschema:"service name (e.g. 'nginx.service' or 'sshd')"`
	User bool   `json:"user,omitempty" jsonschema:"query user-level service (default: false)"`
}

type GetSharedMemorySegmentsInput added in v0.2.10

type GetSharedMemorySegmentsInput struct{}

type GetSystemdUnitsInput

type GetSystemdUnitsInput struct {
	State string `json:"state,omitempty" jsonschema:"optional state filter: 'failed', 'active', 'inactive'"`
}

type GetTopIOProcessesInput

type GetTopIOProcessesInput struct {
	Limit int `json:"limit,omitempty" jsonschema:"max results (default: 10, max: 50)"`
}

type GetUserInfoInput added in v0.2.5

type GetUserInfoInput struct {
	Search string `json:"search,omitempty" jsonschema:"optional username filter (case-insensitive substring match)"`
}

type GetUserInfoOutput added in v0.2.5

type GetUserInfoOutput struct {
	Users []UserInfo `json:"users"`
	OutputErrors
}

func GatherUserInfo added in v0.2.5

func GatherUserInfo(
	ctx context.Context,
	search string,
) (*GetUserInfoOutput, error)

func HandleGetUserInfo added in v0.2.5

func HandleGetUserInfo(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetUserInfoInput,
) (*mcp.CallToolResult, *GetUserInfoOutput, error)

type HardwareBusInfoOutput added in v0.1.5

type HardwareBusInfoOutput struct {
	PCIDevices []BusDevice `json:"pci_devices"`
	USBDevices []BusDevice `json:"usb_devices"`
	OutputErrors
}

func GatherHardwareBusInfo added in v0.1.5

func GatherHardwareBusInfo(
	ctx context.Context,
	search string,
) (*HardwareBusInfoOutput, error)

func HandleGetHardwareBusInfo added in v0.1.5

type HealthCheckItem added in v0.2.9

type HealthCheckItem struct {
	Component string `json:"component"`
	Status    string `json:"status"`
	Detail    string `json:"detail,omitempty"`
}

type IOProcessStat

type IOProcessStat struct {
	Time    string  `json:"time"`
	PID     int     `json:"pid"`
	KbRdS   float64 `json:"kb_rd_s"`
	KbWrS   float64 `json:"kb_wr_s"`
	Command string  `json:"command"`
}

type IOStatDevice added in v0.2.14

type IOStatDevice struct {
	Device     string  `json:"device"`
	ReadKBs    float64 `json:"read_kBs"`
	WriteKBs   float64 `json:"write_kBs"`
	DiscardKBs float64 `json:"discard_kBs,omitempty"`
	ReadsPerS  float64 `json:"reads_per_s"`
	WritesPerS float64 `json:"writes_per_s"`
	AVGWaitMs  float64 `json:"avg_wait_ms"`
	AVGReadMs  float64 `json:"avg_read_ms"`
	AVGWriteMs float64 `json:"avg_write_ms"`
	QueueSize  float64 `json:"queue_size,omitempty"`
	UtilPct    float64 `json:"util_pct,omitempty"`
}

type IOStatsOutput added in v0.2.14

type IOStatsOutput struct {
	Devices []IOStatDevice `json:"devices"`
	OutputErrors
}

func GatherIOStats added in v0.2.14

func GatherIOStats(
	ctx context.Context,
) (*IOStatsOutput, error)

func HandleGetIOStats added in v0.2.14

func HandleGetIOStats(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *IOStatsOutput, error)

type IPInfoOutput added in v0.2.4

type IPInfoOutput struct {
	IP          string   `json:"ip"`
	ASN         string   `json:"asn,omitempty"`
	Org         string   `json:"org,omitempty"`
	Country     string   `json:"country,omitempty"`
	City        string   `json:"city,omitempty"`
	Region      string   `json:"region,omitempty"`
	ServiceTags []string `json:"service_tags,omitempty"`
	OutputErrors
}

func GatherIPInfo added in v0.2.4

func GatherIPInfo(ctx context.Context, ip string) (*IPInfoOutput, error)

func HandleGetIPInfo added in v0.2.4

func HandleGetIPInfo(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetIPInfoInput,
) (*mcp.CallToolResult, *IPInfoOutput, error)

type InodeUsageOutput

type InodeUsageOutput struct {
	Mounts []InodeUsageStat `json:"mounts"`
	OutputErrors
}

func GatherInodeUsage

func GatherInodeUsage(
	ctx context.Context,
	mountPoint string,
) (*InodeUsageOutput, error)

type InodeUsageStat

type InodeUsageStat struct {
	Filesystem  string `json:"filesystem"`
	Inodes      uint64 `json:"inodes"`
	IUsed       uint64 `json:"iused"`
	IFree       uint64 `json:"ifree"`
	IUsePercent string `json:"iuse_percent"`
	MountedOn   string `json:"mounted_on"`
}

type InstalledPackage

type InstalledPackage struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type InstalledPackagesOutput

type InstalledPackagesOutput struct {
	Packages []InstalledPackage `json:"packages"`
	Total    int                `json:"total"`
	OutputErrors
}

func GatherInstalledPackages

func GatherInstalledPackages(
	ctx context.Context,
	name string,
) (*InstalledPackagesOutput, error)

type InterfaceStats

type InterfaceStats struct {
	Name        string `json:"name"`
	BytesSent   uint64 `json:"bytes_sent"`
	BytesRecv   uint64 `json:"bytes_recv"`
	PacketsSent uint64 `json:"packets_sent"`
	PacketsRecv uint64 `json:"packets_recv"`
	ErrorsIn    uint64 `json:"errors_in"`
	ErrorsOut   uint64 `json:"errors_out"`
	DropsIn     uint64 `json:"drops_in"`
	DropsOut    uint64 `json:"drops_out"`
}

type JournalLogEntry

type JournalLogEntry struct {
	Timestamp string `json:"timestamp"`
	Message   string `json:"message"`
	Priority  string `json:"priority,omitempty"`
	Unit      string `json:"unit,omitempty"`
	PID       int    `json:"pid,omitempty"`
}

type JournalLogsOutput

type JournalLogsOutput struct {
	Entries []JournalLogEntry `json:"entries"`
	OutputErrors
}

func GatherJournalLogs

func GatherJournalLogs(
	ctx context.Context, unit, priority, since, until string,
	lines int, user bool,
) (*JournalLogsOutput, error)

type KernelModule added in v0.2.14

type KernelModule struct {
	Name     string   `json:"name"`
	Size     int64    `json:"size"`
	UsedBy   int      `json:"used_by"`
	RefCount int      `json:"ref_count"`
	Deps     []string `json:"deps,omitempty"`
}

type KernelModulesOutput added in v0.2.14

type KernelModulesOutput struct {
	Modules []KernelModule `json:"modules"`
	Total   int            `json:"total"`
	OutputErrors
}

func GatherKernelModules added in v0.2.14

func GatherKernelModules(
	ctx context.Context,
) (*KernelModulesOutput, error)

func HandleGetKernelModules added in v0.2.14

func HandleGetKernelModules(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *KernelModulesOutput, error)

type LargestFileEntry

type LargestFileEntry struct {
	Name      string `json:"name"`
	SizeBytes int64  `json:"size_bytes"`
	SizeHuman string `json:"size_human"`
	IsDir     bool   `json:"is_dir"`
}

type LargestFilesOutput

type LargestFilesOutput struct {
	Path    string             `json:"path"`
	Entries []LargestFileEntry `json:"entries"`
	OutputErrors
}

func GatherLargestFiles

func GatherLargestFiles(
	ctx context.Context,
	path string,
	limit int,
) (*LargestFilesOutput, error)

type ListeningPort

type ListeningPort struct {
	Protocol string `json:"protocol"`
	Address  string `json:"address"`
	Port     string `json:"port"`
	Process  string `json:"process,omitempty"`
}

type ListeningPortsOutput

type ListeningPortsOutput struct {
	Ports []ListeningPort `json:"ports"`
	OutputErrors
}

func GatherListeningPorts

func GatherListeningPorts(
	ctx context.Context,
	protocol string,
) (*ListeningPortsOutput, error)

type LoadAverageOutput

type LoadAverageOutput struct {
	Load1  float64 `json:"load_1"`
	Load5  float64 `json:"load_5"`
	Load15 float64 `json:"load_15"`
	OutputErrors
}

func GatherLoadAverage

func GatherLoadAverage(ctx context.Context) (*LoadAverageOutput, error)

type LoggedInUser

type LoggedInUser struct {
	Username  string `json:"username"`
	Terminal  string `json:"terminal"`
	From      string `json:"from"`
	LoginTime string `json:"login_time"`
}

type LoggedInUsersOutput

type LoggedInUsersOutput struct {
	Users []LoggedInUser `json:"users"`
	OutputErrors
}

func GatherLoggedInUsers

func GatherLoggedInUsers(ctx context.Context) (*LoggedInUsersOutput, error)

type LogrotateConfig added in v0.2.9

type LogrotateConfig struct {
	Path    string `json:"path"`
	Content string `json:"content,omitempty"`
}

type LogrotateStatusOutput added in v0.2.9

type LogrotateStatusOutput struct {
	Configs   []LogrotateConfig `json:"configs"`
	StateFile string            `json:"state_file,omitempty"`
	OutputErrors
}

func GatherLogrotateStatus added in v0.2.9

func GatherLogrotateStatus(
	ctx context.Context,
) (*LogrotateStatusOutput, error)

func HandleGetLogrotateStatus added in v0.2.9

func HandleGetLogrotateStatus(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *LogrotateStatusOutput, error)

type ManPageOutput added in v0.1.2

type ManPageOutput struct {
	Command   string `json:"command"`
	Content   string `json:"content"`
	Truncated bool   `json:"truncated,omitempty"`
	OutputErrors
}

func GatherManPage added in v0.1.2

func GatherManPage(
	ctx context.Context,
	command string,
	maxLines int,
	cleanSpecialChars bool,
	search string,
	contextLines int,
	offset int,
) (*ManPageOutput, error)

func HandleGetManPage added in v0.1.2

func HandleGetManPage(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetManPageInput,
) (*mcp.CallToolResult, *ManPageOutput, error)

type MemoryInfoOutput

type MemoryInfoOutput struct {
	Total           uint64  `json:"total"`
	Used            uint64  `json:"used"`
	Free            uint64  `json:"free"`
	UsedPercent     float64 `json:"used_percent"`
	SwapTotal       uint64  `json:"swap_total"`
	SwapUsed        uint64  `json:"swap_used"`
	SwapFree        uint64  `json:"swap_free"`
	SwapUsedPercent float64 `json:"swap_used_percent"`
	OutputErrors
}

func GatherMemoryInfo

func GatherMemoryInfo(ctx context.Context) (*MemoryInfoOutput, error)

type MountEntry

type MountEntry struct {
	Source  string   `json:"source"`
	Target  string   `json:"target"`
	FSType  string   `json:"fs_type"`
	Options []string `json:"options"`
}

type MountOptionsOutput

type MountOptionsOutput struct {
	Mounts []MountEntry `json:"mounts"`
	OutputErrors
}

func GatherMountOptions

func GatherMountOptions(
	ctx context.Context,
	mountPoint string,
) (*MountOptionsOutput, error)

type NetworkConnection added in v0.2.3

type NetworkConnection struct {
	FD             uint32 `json:"fd"`
	Family         string `json:"family"`
	Type           string `json:"type"`
	LocalAddr      string `json:"local_addr"`
	LocalPort      uint32 `json:"local_port"`
	RemoteAddr     string `json:"remote_addr"`
	RemotePort     uint32 `json:"remote_port"`
	Status         string `json:"status"`
	PID            int32  `json:"pid"`
	ProcessName    string `json:"process_name,omitempty"`
	RemoteHostname string `json:"remote_hostname,omitempty"`
}

type NetworkConnectionsOutput added in v0.2.3

type NetworkConnectionsOutput struct {
	Connections []NetworkConnection `json:"connections"`
	Groups      []ConnectionGroup   `json:"groups,omitempty"`
	OutputErrors
}

func GatherNetworkConnections added in v0.2.3

func GatherNetworkConnections(
	ctx context.Context,
	status string,
	connType string,
	resolveHostnames bool,
	grouped bool,
	maxConnections int,
) (*NetworkConnectionsOutput, error)

func HandleGetNetworkConnections added in v0.2.3

type NetworkInfoOutput

type NetworkInfoOutput struct {
	Interfaces []InterfaceStats `json:"interfaces"`
	OutputErrors
}

func GatherNetworkInfo

func GatherNetworkInfo(ctx context.Context) (*NetworkInfoOutput, error)

type NoArgs added in v0.2.6

type NoArgs struct{}

NoArgs is used for tools that accept no parameters.

type OutputErrors added in v0.2.1

type OutputErrors struct {
	Errors []string `json:"errors,omitempty"`
}

OutputErrors is embedded in output structs for error accumulation.

func (*OutputErrors) Add added in v0.2.1

func (o *OutputErrors) Add(context string, err error)

func (*OutputErrors) AppendError added in v0.2.1

func (o *OutputErrors) AppendError(s string)

func (OutputErrors) Err added in v0.2.1

func (o OutputErrors) Err() error

func (OutputErrors) ErrorCount added in v0.2.1

func (o OutputErrors) ErrorCount() int

type PasswordPolicyInfo added in v0.2.9

type PasswordPolicyInfo struct {
	PassMaxDays string `json:"pass_max_days,omitempty"`
	PassMinDays string `json:"pass_min_days,omitempty"`
	PassWarnAge string `json:"pass_warn_age,omitempty"`
}

type PingHostInput

type PingHostInput struct {
	Host    string `json:"host"              jsonschema:"hostname or IP address to ping"`
	Count   int    `json:"count,omitempty"   jsonschema:"number of packets (default: 4)"`
	Timeout int    `json:"timeout,omitempty" jsonschema:"timeout in seconds (default: 10)"`
}

type PingOutput

type PingOutput struct {
	Host               string  `json:"host"`
	PacketsTransmitted int     `json:"packets_transmitted"`
	PacketsReceived    int     `json:"packets_received"`
	PacketLossPercent  float64 `json:"packet_loss_percent"`
	MinLatencyMs       float64 `json:"min_latency_ms"`
	AvgLatencyMs       float64 `json:"avg_latency_ms"`
	MaxLatencyMs       float64 `json:"max_latency_ms"`
	OutputErrors
}

func GatherPing

func GatherPing(
	ctx context.Context,
	host string,
	count, timeout int,
) (*PingOutput, error)

func HandlePingHost

func HandlePingHost(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input PingHostInput,
) (*mcp.CallToolResult, *PingOutput, error)

type PowerAnalyticsOutput added in v0.2.1

type PowerAnalyticsOutput struct {
	ACOnline            bool    `json:"ac_online"`
	BatteryPercent      float64 `json:"battery_percent"`
	DischargeRateWatts  float64 `json:"discharge_rate_watts"`
	CapacityDegradation float64 `json:"capacity_degradation_percent"`
	OutputErrors
}

func GatherPowerAnalytics added in v0.2.1

func GatherPowerAnalytics(ctx context.Context) (*PowerAnalyticsOutput, error)

func HandleGetPowerAnalytics added in v0.2.1

func HandleGetPowerAnalytics(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *PowerAnalyticsOutput, error)

type ProcDiagnosticsOutput added in v0.2.9

type ProcDiagnosticsOutput struct {
	Interrupts  []string         `json:"interrupts,omitempty"`
	SoftIRQs    []SoftIRQInfo    `json:"softirqs,omitempty"`
	VMStat      *VMStatInfo      `json:"vmstat,omitempty"`
	DiskStats   []ProcDiskStat   `json:"diskstats,omitempty"`
	Filesystems []FilesystemInfo `json:"filesystems,omitempty"`
	Version     string           `json:"version,omitempty"`
	SlabInfo    []SlabInfoEntry  `json:"slabinfo,omitempty"`
	OutputErrors
}

func GatherProcDiagnostics added in v0.2.9

func GatherProcDiagnostics(
	ctx context.Context, sections string,
) (*ProcDiagnosticsOutput, error)

func HandleGetProcDiagnostics added in v0.2.9

type ProcDiskStat added in v0.2.9

type ProcDiskStat struct {
	Device          string `json:"device"`
	ReadsCompleted  uint64 `json:"reads_completed"`
	ReadsMerged     uint64 `json:"reads_merged"`
	SectorsRead     uint64 `json:"sectors_read"`
	ReadMs          uint64 `json:"read_ms"`
	WritesCompleted uint64 `json:"writes_completed"`
	WritesMerged    uint64 `json:"writes_merged"`
	SectorsWritten  uint64 `json:"sectors_written"`
	WriteMs         uint64 `json:"write_ms"`
	IOsInProgress   uint64 `json:"ios_in_progress"`
	IoMs            uint64 `json:"io_ms"`
	WeightedIoMs    uint64 `json:"weighted_io_ms"`
}

type ProcessFD added in v0.2.1

type ProcessFD struct {
	FD     uint64 `json:"fd"`
	Type   string `json:"type"`
	Target string `json:"target"`
}

type ProcessFDsOutput added in v0.2.1

type ProcessFDsOutput struct {
	PID   int         `json:"pid"`
	Name  string      `json:"name"`
	Count int         `json:"fd_count"`
	FDs   []ProcessFD `json:"file_descriptors"`
	OutputErrors
}

func GatherProcessFDs added in v0.2.1

func GatherProcessFDs(
	ctx context.Context,
	pid int32,
) (*ProcessFDsOutput, error)

func HandleGetProcessFDs added in v0.2.1

func HandleGetProcessFDs(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetProcessFDsInput,
) (*mcp.CallToolResult, *ProcessFDsOutput, error)

type ProcessInfoOutput

type ProcessInfoOutput struct {
	Processes []ProcessStat `json:"processes,omitempty"`
	ByCPU     []ProcessStat `json:"by_cpu,omitempty"`
	ByMemory  []ProcessStat `json:"by_memory,omitempty"`
	OutputErrors
}

func GatherProcessInfo

func GatherProcessInfo(
	ctx context.Context,
	sortBy string,
	limit int,
) (*ProcessInfoOutput, error)

type ProcessStat

type ProcessStat struct {
	PID           int32   `json:"pid"`
	Name          string  `json:"name"`
	CPUPercent    float64 `json:"cpu_percent"`
	MemoryPercent float32 `json:"memory_percent"`
	Status        string  `json:"status"`
	RSSBytes      *int64  `json:"rss_bytes,omitempty"`
	PSSBytes      *int64  `json:"pss_bytes,omitempty"`
	SwapBytes     *int64  `json:"swap_bytes,omitempty"`
	CgroupPath    *string `json:"cgroup_path,omitempty"`
}

type ProcessTreeNode added in v0.2.14

type ProcessTreeNode struct {
	PID    int32  `json:"pid"`
	PPID   int32  `json:"ppid"`
	Name   string `json:"name"`
	Depth  int    `json:"depth"`
	IsLeaf bool   `json:"is_leaf"`
}

type ProcessTreeOutput added in v0.2.14

type ProcessTreeOutput struct {
	Nodes    []ProcessTreeNode `json:"nodes"`
	Total    int               `json:"total"`
	Filtered bool              `json:"filtered,omitempty"`
	OutputErrors
}

func GatherProcessTree added in v0.2.14

func GatherProcessTree(
	ctx context.Context,
	pid *int32,
) (*ProcessTreeOutput, error)

func HandleGetProcessTree added in v0.2.14

func HandleGetProcessTree(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetProcessTreeInput,
) (*mcp.CallToolResult, *ProcessTreeOutput, error)

type RAIDDevice added in v0.2.9

type RAIDDevice struct {
	Name       string `json:"name"`
	Level      string `json:"level"`
	ArraySize  string `json:"array_size"`
	Status     string `json:"status"`
	ActiveDevs int    `json:"active_devices"`
	TotalDevs  int    `json:"total_devices"`
	Devices    string `json:"devices,omitempty"`
}

type RAIDStatusOutput added in v0.2.9

type RAIDStatusOutput struct {
	Devices []RAIDDevice `json:"devices"`
	OutputErrors
}

func GatherRAIDStatus added in v0.2.9

func GatherRAIDStatus(ctx context.Context) (*RAIDStatusOutput, error)

func HandleGetRAIDStatus added in v0.2.9

func HandleGetRAIDStatus(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *RAIDStatusOutput, error)

type ResolveDNSInput

type ResolveDNSInput struct {
	Hostname string `json:"hostname" jsonschema:"hostname to resolve (e.g. 'example.com')"`
}

type ResolveDNSOutput

type ResolveDNSOutput struct {
	Hostname  string   `json:"hostname"`
	Addresses []string `json:"addresses"`
	OutputErrors
}

func GatherDNSResolve

func GatherDNSResolve(
	ctx context.Context,
	hostname string,
) (*ResolveDNSOutput, error)

type RouteEntry added in v0.2.14

type RouteEntry struct {
	Destination string `json:"destination"`
	Gateway     string `json:"gateway,omitempty"`
	Interface   string `json:"interface"`
	Proto       string `json:"proto,omitempty"`
	Scope       string `json:"scope,omitempty"`
	Type        string `json:"type,omitempty"`
	Metric      int    `json:"metric,omitempty"`
	MTU         int    `json:"mtu,omitempty"`
}

type RoutingTableOutput added in v0.2.14

type RoutingTableOutput struct {
	Routes []RouteEntry `json:"routes"`
	Total  int          `json:"total"`
	OutputErrors
}

func GatherRoutingTable added in v0.2.14

func GatherRoutingTable(
	ctx context.Context,
) (*RoutingTableOutput, error)

func HandleGetRoutingTable added in v0.2.14

func HandleGetRoutingTable(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *RoutingTableOutput, error)

type SELinuxAppArmorOutput added in v0.2.9

type SELinuxAppArmorOutput struct {
	SELinux  string `json:"selinux"`
	AppArmor string `json:"apparmor"`
	OutputErrors
}

func GatherSELinuxAppArmorStatus added in v0.2.9

func GatherSELinuxAppArmorStatus(
	ctx context.Context,
) (*SELinuxAppArmorOutput, error)

func HandleGetSELinuxAppArmorStatus added in v0.2.9

func HandleGetSELinuxAppArmorStatus(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *SELinuxAppArmorOutput, error)

type SMARTDeviceHealth added in v0.2.9

type SMARTDeviceHealth struct {
	Device       string            `json:"device"`
	Model        string            `json:"model,omitempty"`
	Serial       string            `json:"serial,omitempty"`
	HealthStatus string            `json:"health_status"`
	Temperature  int               `json:"temperature,omitempty"`
	PowerOnHours int               `json:"power_on_hours,omitempty"`
	Attributes   map[string]string `json:"attributes,omitempty"`
	RawOutput    string            `json:"raw_output,omitempty"`
}

type SMARTHealthOutput added in v0.2.9

type SMARTHealthOutput struct {
	Devices []SMARTDeviceHealth `json:"devices"`
	OutputErrors
}

func GatherSMARTHealth added in v0.2.9

func GatherSMARTHealth(
	ctx context.Context,
	device string,
) (*SMARTHealthOutput, error)

func HandleGetSMARTHealth added in v0.2.9

func HandleGetSMARTHealth(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetSMARTHealthInput,
) (*mcp.CallToolResult, *SMARTHealthOutput, error)

type SSHHardeningInfo added in v0.2.9

type SSHHardeningInfo struct {
	PermitRootLogin        string `json:"permit_root_login,omitempty"`
	PasswordAuthentication string `json:"password_authentication,omitempty"`
	PubkeyAuthentication   string `json:"pubkey_authentication,omitempty"`
	X11Forwarding          string `json:"x11_forwarding,omitempty"`
	MaxAuthTries           string `json:"max_auth_tries,omitempty"`
	Protocol               string `json:"protocol,omitempty"`
	ConfigPresent          bool   `json:"config_present"`
}

type SecurityAuditOutput added in v0.2.9

type SecurityAuditOutput struct {
	Firewall       FirewallInfo       `json:"firewall"`
	SSHHardening   SSHHardeningInfo   `json:"ssh_hardening"`
	SUIDBinaries   []string           `json:"suid_binaries"`
	WorldWritable  []string           `json:"world_writable_files"`
	Umask          string             `json:"umask"`
	PasswordPolicy PasswordPolicyInfo `json:"password_policy"`
	Score          int                `json:"security_score"`
	OutputErrors
}

func GatherSecurityAudit added in v0.2.9

func GatherSecurityAudit(ctx context.Context) (*SecurityAuditOutput, error)

func HandleGetSecurityAudit added in v0.2.9

func HandleGetSecurityAudit(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *SecurityAuditOutput, error)

type ServiceStatusOutput

type ServiceStatusOutput struct {
	Name   string `json:"name"`
	Loaded string `json:"loaded,omitempty"`
	Active string `json:"active,omitempty"`
	PID    string `json:"pid,omitempty"`
	Output string `json:"output"`
	OutputErrors
}

func GatherServiceStatus

func GatherServiceStatus(
	ctx context.Context, name string, user bool,
) (*ServiceStatusOutput, error)

type SharedMemoryOutput added in v0.2.10

type SharedMemoryOutput struct {
	Segments []ShmSegment `json:"segments"`
	OutputErrors
}

func GatherSharedMemorySegments added in v0.2.10

func GatherSharedMemorySegments() (*SharedMemoryOutput, error)

func HandleGetSharedMemorySegments added in v0.2.10

func HandleGetSharedMemorySegments(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	input GetSharedMemorySegmentsInput,
) (*mcp.CallToolResult, *SharedMemoryOutput, error)

type ShmSegment added in v0.2.10

type ShmSegment struct {
	Key       int64  `json:"key"`
	ID        int64  `json:"id"`
	Owner     string `json:"owner"`
	Bytes     int64  `json:"bytes"`
	Nattch    int32  `json:"nattch"`
	CPID      int32  `json:"cpid"`
	LPID      int32  `json:"lpid"`
	AttachAt  string `json:"attach_at"`
	DetachAt  string `json:"detach_at"`
	CreatTime string `json:"creat_time"`
}

type SlabInfoEntry added in v0.2.9

type SlabInfoEntry struct {
	Name       string `json:"name"`
	ActiveObjs uint64 `json:"active_objs"`
	NumObjs    uint64 `json:"num_objs"`
	ObjSize    uint64 `json:"obj_size"`
}

type SoftIRQInfo added in v0.2.9

type SoftIRQInfo struct {
	Type  string `json:"type"`
	Total uint64 `json:"total"`
}

type SystemHealthCheckOutput added in v0.2.9

type SystemHealthCheckOutput struct {
	Overall string            `json:"overall"`
	Checks  []HealthCheckItem `json:"checks"`
	OutputErrors
}

func GatherSystemHealthCheck added in v0.2.9

func GatherSystemHealthCheck(
	ctx context.Context,
) (*SystemHealthCheckOutput, error)

func HandleGetSystemHealthCheck added in v0.2.9

func HandleGetSystemHealthCheck(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *SystemHealthCheckOutput, error)

type SystemInfoOutput

type SystemInfoOutput struct {
	Hostname             string `json:"hostname"`
	OSName               string `json:"os_name"`
	OSVersion            string `json:"os_version"`
	KernelVersion        string `json:"kernel_version"`
	Architecture         string `json:"architecture"`
	UptimeSeconds        uint64 `json:"uptime_seconds"`
	Platform             string `json:"platform,omitempty"`
	PlatformFamily       string `json:"platform_family,omitempty"`
	BootTime             uint64 `json:"boot_time,omitempty"`
	Procs                uint64 `json:"procs,omitempty"`
	VirtualizationSystem string `json:"virtualization_system,omitempty"`
	VirtualizationRole   string `json:"virtualization_role,omitempty"`
	HostID               string `json:"host_id,omitempty"`
	Manufacturer         string `json:"manufacturer,omitempty"`
	ProductName          string `json:"product_name,omitempty"`
	ProductVersion       string `json:"product_version,omitempty"`
	BIOSVersion          string `json:"bios_version,omitempty"`
	BIOSDate             string `json:"bios_date,omitempty"`
	TPMVersion           string `json:"tpm_version,omitempty"`
	OutputErrors
}

func GatherSystemInfo

func GatherSystemInfo(ctx context.Context) (*SystemInfoOutput, error)

type SystemSnapshotOutput

type SystemSnapshotOutput struct {
	System      SystemInfoOutput     `json:"system"`
	CPU         CPUInfoOutput        `json:"cpu"`
	Temperature CPUTemperatureOutput `json:"temperature"`
	Memory      MemoryInfoOutput     `json:"memory"`
	Disk        DiskInfoOutput       `json:"disk"`
	Network     NetworkInfoOutput    `json:"network"`
	LoadAverage LoadAverageOutput    `json:"load_average"`
	Processes   ProcessInfoOutput    `json:"processes"`
	Docker      DockerInfoOutput     `json:"docker"`
	OutputErrors
}

type SystemdTimer added in v0.1.8

type SystemdTimer struct {
	Unit      string `json:"unit"`
	Activates string `json:"activates"`
	Next      string `json:"next,omitempty"`
	Last      string `json:"last,omitempty"`
}

type SystemdUnit

type SystemdUnit struct {
	Unit        string `json:"unit"`
	Load        string `json:"load"`
	Active      string `json:"active"`
	Sub         string `json:"sub"`
	Description string `json:"description"`
}

type SystemdUnitsOutput

type SystemdUnitsOutput struct {
	Units []SystemdUnit `json:"units"`
	OutputErrors
}

func GatherSystemdUnits

func GatherSystemdUnits(
	ctx context.Context,
	state string,
) (*SystemdUnitsOutput, error)

type TemperatureStat

type TemperatureStat struct {
	SensorKey   string  `json:"sensor_key"`
	Temperature float64 `json:"temperature_celsius"`
}

type TimeSyncStatusOutput added in v0.2.9

type TimeSyncStatusOutput struct {
	NTPService     string `json:"ntp_service"`
	SyncStatus     string `json:"sync_status"`
	NTPEnabled     bool   `json:"ntp_enabled"`
	SystemClock    string `json:"system_clock_utc"`
	RTCTime        string `json:"rtc_time,omitempty"`
	TimeServer     string `json:"time_server,omitempty"`
	Stratum        int    `json:"stratum,omitempty"`
	LastSyncMs     int    `json:"last_sync_ms,omitempty"`
	ChronyPresent  bool   `json:"chrony_present"`
	NTPDatePresent bool   `json:"ntpdate_present"`
	OutputErrors
}

func GatherTimeSyncStatus added in v0.2.9

func GatherTimeSyncStatus(ctx context.Context) (*TimeSyncStatusOutput, error)

func HandleGetTimeSyncStatus added in v0.2.9

func HandleGetTimeSyncStatus(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *TimeSyncStatusOutput, error)

type TopIOProcessesOutput

type TopIOProcessesOutput struct {
	Processes []IOProcessStat `json:"processes"`
	OutputErrors
}

func GatherTopIOProcesses

func GatherTopIOProcesses(
	ctx context.Context,
	limit int,
) (*TopIOProcessesOutput, error)

type UserAutomationOutput added in v0.1.8

type UserAutomationOutput struct {
	CronJobs      []CronJob      `json:"cron_jobs"`
	SystemdTimers []SystemdTimer `json:"systemd_timers"`
	OutputErrors
}

func GatherUserAutomation added in v0.1.8

func GatherUserAutomation(
	ctx context.Context,
) (*UserAutomationOutput, error)

func HandleGetUserAutomation added in v0.1.8

func HandleGetUserAutomation(
	ctx context.Context,
	_ *mcp.CallToolRequest,
	_ NoArgs,
) (*mcp.CallToolResult, *UserAutomationOutput, error)

type UserInfo added in v0.2.5

type UserInfo struct {
	Username string   `json:"username"`
	UID      int      `json:"uid"`
	GID      int      `json:"gid"`
	HomeDir  string   `json:"home_directory"`
	Shell    string   `json:"shell"`
	Groups   []string `json:"groups,omitempty"`
}

type VMStatInfo added in v0.2.9

type VMStatInfo struct {
	Metrics map[string]uint64 `json:"metrics"`
}

Jump to

Keyboard shortcuts

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