Documentation ¶
Index ¶
- Constants
- Variables
- func CommandWithCallback(callback func(line string), name string, arg ...string) error
- func GenCPUInfo(context *table.QueryContext) (table.TableRows, error)
- func GenCrontab(context *table.QueryContext) (table.TableRows, error)
- func GenDebPackages(context *table.QueryContext) (table.TableRows, error)
- func GenHash(context *table.QueryContext) (table.TableRows, error)
- func GenLast(context *table.QueryContext) (table.TableRows, error)
- func GenLoads(context *table.QueryContext) (table.TableRows, error)
- func GenMemoryInfo(context *table.QueryContext) (table.TableRows, error)
- func GenOSVersion(context *table.QueryContext) (table.TableRows, error)
- func GenProcesses(context *table.QueryContext) (table.TableRows, error)
- func GenRpmPackages(context *table.QueryContext) (table.TableRows, error)
- func GenSSHKeys(context *table.QueryContext) (table.TableRows, error)
- func GenShadow(context *table.QueryContext) (table.TableRows, error)
- func GenShellHistory(context *table.QueryContext) (table.TableRows, error)
- func GenUsers(context *table.QueryContext) (table.TableRows, error)
- type Cron
- type ProcIO
- type ProcStat
- type Shadow
- type User
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 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 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 GenSSHKeys ¶ added in v1.3.5
func GenSSHKeys(context *table.QueryContext) (table.TableRows, error)
func GenShadow ¶ added in v1.3.6
func GenShadow(context *table.QueryContext) (table.TableRows, error)
func GenShellHistory ¶
func GenShellHistory(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 ¶
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 ¶
type Shadow ¶ added in v1.3.6
type Shadow struct { Username string `json:"username"` PasswordStatus string `json:"password_status"` Hash string `json:"hash"` //加密后的用户密码 LastChange int64 `json:"last_change"` //上次密码修改时间。从1970年1月1日以来的天数 Min int64 `json:"min"` //密码最短使用时间。在这段时间内用户不能更改密码。 Max int64 `json:"max"` //密码最长使用时间。到达这个天数后必须更改密码。 Warning int64 `json:"warning"` //密码到期前多少天发出警告 Inactive int64 `json:"inactive"` //密码过期后账户被禁用前的天数。在这段时间内如果用户未更改密码,账户将被禁用。 Expire int64 `json:"expire"` //账户过期日期。从1970年1月1日以来的天数,过了这个日期,账户将被完全禁用。 Flag int64 `json:"flag"` //保留字段,目前未被广泛使用,通常为空。 }
Click to show internal directories.
Click to hide internal directories.