system

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMPTY         = 0
	RUN_LVL       = 1
	BOOT_TIME     = 2
	OLD_TIME      = 3
	NEW_TIME      = 4
	INIT_PROCESS  = 5
	LOGIN_PROCESS = 6
	USER_PROCESS  = 7
	DEAD_PROCESS  = 8
)

Variables

View Source
var (
	ShellHistoryFiles = []string{
		".bash_history",
		".zsh_history",
		".zhistory",
		".history",
		".sh_history",
	}
	BashTimestampRx = regexp.MustCompile("^#([0-9]+)$")
	ZshTimestampRx  = regexp.MustCompile("^: {0,10}([0-9]{1,11}):[0-9]+;(.*)$")
)
View Source
var (
	CronSearchDirs = []string{
		"/etc/cron.d/",
		"/var/at/tabs/",
		"/var/spool/cron/",
		"/var/spool/cron/crontabs/",
	}
)

Functions

func CommandWithCallback

func CommandWithCallback(callback func(line string), name string, arg ...string) error

func GenCPUInfo

func GenCPUInfo(context *table.QueryContext) (table.TableRows, error)

func GenCrontab

func GenCrontab(context *table.QueryContext) (table.TableRows, error)

func GenDebPackages

func GenDebPackages(context *table.QueryContext) (table.TableRows, error)

func GenHash

func GenHash(context *table.QueryContext) (table.TableRows, error)

func GenLast

func GenLast(context *table.QueryContext) (table.TableRows, error)

func GenLoads

func GenLoads(context *table.QueryContext) (table.TableRows, error)

func GenMemoryInfo

func GenMemoryInfo(context *table.QueryContext) (table.TableRows, error)

func GenOSVersion

func GenOSVersion(context *table.QueryContext) (table.TableRows, error)

func GenProcesses

func GenProcesses(context *table.QueryContext) (table.TableRows, error)

func GenRpmPackages

func GenRpmPackages(context *table.QueryContext) (table.TableRows, error)

func GenShellHistory

func GenShellHistory(context *table.QueryContext) (table.TableRows, error)

func GenUsers

func GenUsers(context *table.QueryContext) (table.TableRows, error)

Types

type Cron

type Cron struct {
	Event      string
	Command    string
	Minute     string
	Hour       string
	DayOfMonth string
	Month      string
	DayOfWeek  string
}

func CronFileParser

func CronFileParser(filePath string) ([]Cron, error)

type ProcIO

type ProcIO struct {
	ReadBytes           int64
	WriteBytes          int64
	CancelledWriteBytes int64
}

func GetProcIO

func GetProcIO(pid int32) (*ProcIO, error)

type ProcStat

type ProcStat struct {
	Terminal   uint64
	Parent     int64
	UTime      float64
	STime      float64
	PGroup     int64
	State      string
	UserTime   int64
	SystemTime int64
	Nice       int64
	Threads    int64
	StartTime  int64
}

func GetProcStat

func GetProcStat(pid int32) (*ProcStat, error)

Jump to

Keyboard shortcuts

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