Documentation ¶
Index ¶
- Constants
- Variables
- func AnalyzeLine2HDDevUsageInfo(lineInfo string) (model.HDDevUsage, error)
- func DiskUsage(path string) (disk model.DiskStatus)
- func GetAppUser() (myUsers []model.AppUser)
- func GetApplicationInfo() (myApplicationInfos model.ApplicationInfo)
- func GetConnectionStatInfo(max int) ([]model.ConnectionStat, error)
- func GetCpuInfo() (c model.Cpu, err error)
- func GetCronTask() (myCrons []model.CronTask)
- func GetDisksInfo() (d []model.Disk, err error)
- func GetHardwareInfo() (h model.HardwareInfo, err error)
- func GetHistoryLog(num int, str string) (historyLog model.HistoryLog)
- func GetHostInfo() (s model.HostInfoService, err error)
- func GetHostInfoFunc(list []string) (s model.HostInfoService, cnName map[string]string, hostInfo []string)
- func GetHostLog(num int, str string) (s model.HostLog)
- func GetIPTableInfo() (i model.Iptable, err error)
- func GetLastLog(num int, str string) (result []model.LoginLog)
- func GetLogInfo(num int, hostStr, historyStr, lastStr string) (s model.LogInfo)
- func GetLoginInfo(list []string) (name, remote, time, status string)
- func GetMemoryInfo() (m model.Memory, err error)
- func GetNetCardInfo() (NetCardList []model.NetCard, err error)
- func GetNetCardUUid(name string) (string, error)
- func GetNetworkInfo() (s model.NetworkInfo)
- func GetPasswordPolicy() (p model.PasswordPolicy, err error)
- func GetPolicyInfo() (p model.PolicyInfo, err error)
- func GetRunTimeInfo() (s model.RunTimeInfo, err error)
- func GetServiceInfo() (myServices []model.Service)
- func GetSpecialStatus() (R, S, T, I, Z, W, L, count int)
- func GetSwapInfo() (s model.Swap, err error)
- func GetSysMTabInfo() ([]model.HDDevUsage, error)
- func GetTaskInfo() (taskList []model.Task, err error)
- func GetWebLog() (s model.WebLog, err error)
- func SetLinuxStr()
- func SetLinuxSystem(s string)
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var (
LinuxSystem string = "centos"
)
View Source
var ProcessorStat = make(map[string]int)
View Source
var ResultCount = 50
Functions ¶
func AnalyzeLine2HDDevUsageInfo ¶
func AnalyzeLine2HDDevUsageInfo(lineInfo string) (model.HDDevUsage, error)
func GetAppUser ¶
func GetApplicationInfo ¶
func GetApplicationInfo() (myApplicationInfos model.ApplicationInfo)
func GetConnectionStatInfo ¶
func GetConnectionStatInfo(max int) ([]model.ConnectionStat, error)
GetConnectionStatInfo 获取netstat信息 max为获取数据限制数量 0=all
func GetCpuInfo ¶
func GetCronTask ¶
func GetDisksInfo ¶
func GetHardwareInfo ¶
func GetHardwareInfo() (h model.HardwareInfo, err error)
func GetHistoryLog ¶
func GetHistoryLog(num int, str string) (historyLog model.HistoryLog)
GetHistoryLog 通过命令 cat ~/.bash_history | tail -n 50 获取历史命令行输入 传入参数为tail数量、grep的字符串
func GetHostInfo ¶
func GetHostInfo() (s model.HostInfoService, err error)
func GetHostInfoFunc ¶
func GetHostLog ¶
GetHostLog 通过命令 cat /var/log/secure | tail -n 50 获取Secure 传入参数为tail数量、grep的字符串
func GetIPTableInfo ¶
func GetLastLog ¶
GetLastLog 通过命令 last -n 50 --time-format iso -R 获取登录日志 传入参数为tail数量、grep的字符串
func GetLoginInfo ¶
func GetMemoryInfo ¶
func GetNetCardInfo ¶
func GetNetworkInfo ¶
func GetNetworkInfo() (s model.NetworkInfo)
func GetPasswordPolicy ¶
func GetPasswordPolicy() (p model.PasswordPolicy, err error)
func GetPolicyInfo ¶
func GetPolicyInfo() (p model.PolicyInfo, err error)
func GetRunTimeInfo ¶
func GetRunTimeInfo() (s model.RunTimeInfo, err error)
func GetServiceInfo ¶
func GetSpecialStatus ¶
func GetSpecialStatus() (R, S, T, I, Z, W, L, count int)
GetSpecialStatus 状态返回进程状态。返回值可能是其中之一。R:运行 S:睡眠 T:停止 I:空闲 Z:僵尸 W:等待 L:锁定
func GetSwapInfo ¶
func GetSysMTabInfo ¶
func GetSysMTabInfo() ([]model.HDDevUsage, error)
func GetTaskInfo ¶
func SetLinuxSystem ¶ added in v1.0.2
func SetLinuxSystem(s string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.