sysctl

package
v0.0.0-...-85fb7fb Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sysctl is used to process and analyze sysctl data

Package sysctl is used to process and analyze sysctl data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snapshot

type Snapshot struct {
	// Proc contains the /proc system control parameters and their values
	Proc map[string]interface{} `json:"proc,omitempty"`
	// Sys contains the /sys system control parameters and their values
	Sys map[string]interface{} `json:"sys,omitempty"`
	// CPUFlags contains the list of flags of the current CPU
	CPUFlags []string `json:"cpu_flags,omitempty"`
	// KernelCmdline contains the kernel command line parameters
	KernelCmdline string `json:"kernel_cmdline,omitempty"`
	// KernelCompilationConfiguration contains the kernel compilation configuration
	KernelCompilationConfiguration map[string]string `json:"kernel_compilation_configuration,omitempty"`
}

Snapshot defines an internal core dump

func NewSnapshot

func NewSnapshot() Snapshot

NewSnapshot returns a new sysctl snapshot

func (*Snapshot) InsertSnapshotEntry

func (s *Snapshot) InsertSnapshotEntry(data map[string]interface{}, file string, value string)

InsertSnapshotEntry inserts the provided file and its value in the input data

func (*Snapshot) Snapshot

func (s *Snapshot) Snapshot(ignoredBaseNames []string, kernelCompilationFlags map[string]uint8) error

Snapshot runs the snapshot by going through the filesystem

func (*Snapshot) ToJSON

func (s *Snapshot) ToJSON() ([]byte, error)

ToJSON serializes the current Snapshot object to JSON

type SnapshotEvent

type SnapshotEvent struct {
	Sysctl Snapshot `json:"sysctl"`
}

SnapshotEvent is a wrapper used for serialization

func NewSnapshotEvent

func NewSnapshotEvent(ignoredBaseNames []string, kernelCompilationFlags map[string]uint8) (*SnapshotEvent, error)

NewSnapshotEvent returns a new sysctl snapshot event

func (*SnapshotEvent) ToJSON

func (s *SnapshotEvent) ToJSON() ([]byte, error)

ToJSON serializes the current SnapshotEvent object to JSON

Jump to

Keyboard shortcuts

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