Documentation ¶
Index ¶
- Constants
- Variables
- type Addr
- type AppUser
- type ApplicationInfo
- type ConnectionStat
- type Cpu
- type CronTask
- type Disk
- type DiskStatus
- type HDDevUsage
- type HardwareInfo
- type HistoryLog
- type HostInfoService
- type HostLog
- type Iptable
- type LogInfo
- type LoginLog
- type Memory
- type NetCard
- type NetworkInfo
- type OtherLog
- type PassWordComplexity
- type PasswordPolicy
- type PolicyInfo
- type RunTimeInfo
- type Service
- type Swap
- type SystemFiles
- type SystemInfo
- type SystemProperties
- type Task
- type Ufw
- type WebLog
- type WebLogInfo
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var ResultCount = 50
Functions ¶
This section is empty.
Types ¶
type ApplicationInfo ¶
type ApplicationInfo struct { ServiceList []Service `xlsx:"服务信息"` CronTaskList []CronTask `xlsx:"定时任务信息"` UserList []AppUser `xlsx:"用户信息"` }
应用信息
type ConnectionStat ¶
type ConnectionStat struct { Fd uint32 `xlsx:"Fd"` Family uint32 `xlsx:"Family"` // tcp 0x2 udp 0x2 tcp6 0xa unix 0x1 Type uint32 `xlsx:"套接字类型"` //Socket 1TCP 2UDP LocalAddr Addr `xlsx:"LocalAddr"` RemoteAddr Addr `xlsx:"RemoteAddr"` Status string `xlsx:"状态"` Uids []int32 `xlsx:"Uids"` Pid int32 `xlsx:"Pid"` }
type CronTask ¶
type CronTask struct { CronValue string `xlsx:"定时任务频率"` //定时任务频率 Shell string `xlsx:"执行脚本或者脚本路径"` //执行脚本或者脚本路径 }
定时任务信息
type DiskStatus ¶
type HDDevUsage ¶
type HardwareInfo ¶
type HardwareInfo struct { Cpu Cpu `xlsx:"CPU信息"` //cpu信息 Memory Memory `xlsx:"内存信息"` //内存信息 Disks []Disk `xlsx:"磁盘信息"` //磁盘信息 Swap Swap `xlsx:"交换区"` //交换区 }
系统硬件信息
type HistoryLog ¶
type HistoryLog struct {
HistoryLogList []string `xlsx:"历史日志列表"`
}
type HostInfoService ¶
type HostInfoService struct { HardwareInfoService HardwareInfo `xlsx:"硬件信息"` RunTimeInfoService RunTimeInfo `xlsx:"运行时信息"` ApplicationInfoService ApplicationInfo `xlsx:"应用信息"` NetworkInfoService NetworkInfo `xlsx:"网络信息"` LogInfoService LogInfo `xlsx:"日志信息"` PolicyInfoService PolicyInfo `xlsx:"策略信息"` }
服务器档案
type LogInfo ¶
type LogInfo struct { HostLog HostLog `xlsx:"主机日志"` WebLog WebLog `xlsx:"网络日志"` HistoryLog HistoryLog `xlsx:"历史日志"` //历史命令日志 LoginLog []LoginLog `xlsx:"登录日志"` //登录信息 }
LogInfo /**
type NetCard ¶
type NetCard struct { Device int `xlsx:"网卡设备"` //网卡设备 Name string `xlsx:"网卡名称"` Type string `xlsx:"网络类型"` //网络类型 UUID string `xlsx:"标识符"` //标识符 IPAddr string `xlsx:"IP地址"` //ip地址 HWAddr string `xlsx:"Mac地址"` //Mac地址 NetMask string `xlsx:"子网掩码"` //子网掩码 GateWay string `xlsx:"网关"` //网关 IPType string `xlsx:"网卡获取ip方式"` //网卡获取ip方式 dhcp ,none ,static OnBoote bool `xlsx:"开机自启动"` //开机自启动 }
网卡信息
type NetworkInfo ¶
type NetworkInfo struct { NetCards []NetCard `json:"网卡状况" xlsx:"网卡信息"` //网卡状况 ConnectionStat []ConnectionStat `json:"netstat" xlsx:"连接信息"` }
type PassWordComplexity ¶
type PassWordComplexity struct { Difok string `xlsx:"本次密码与上次密码至少不同字符数"` //本次密码与上次密码至少不同字符数 Minlen string `xlsx:"密码最小长度"` //密码最小长度,此配置优先于login.defs中的PASS_MAX_DAYS Ucredit string `xlsx:"最少大写字母"` //最少大写字母 Lcredit string `xlsx:"最少小写字母"` //最少小写字母 Dcredit string `xlsx:"最少数字"` //最少数字 Retry string `xlsx:"重试多少次后返回密码修改错误"` //重试多少次后返回密码修改错误 }
type PasswordPolicy ¶
type PasswordPolicy struct { MaxDay string `xlsx:"最大时间"` //最大时间 MinDay string `xlsx:"最小时间"` MinLen string `xlsx:"最小密码长度"` //最小密码长度 WarnAge string `xlsx:"警告时间"` //警告时间 PassWordComplexity PassWordComplexity `xlsx:"密码复杂度"` //密码复杂度 DenyTime string `xlsx:"失败拒绝次数"` //失败拒绝次数 LockTime string `xlsx:"锁定次数"` //锁定次数 UnLockTime string `xlsx:"解锁时间"` //解锁时间 }
type PolicyInfo ¶
type PolicyInfo struct { PassWordPolicy PasswordPolicy `xlsx:"密码策略"` //密码策略 AuditPolicy map[string]bool `xlsx:"审计策略"` //审计策略:检测auditd 和 rsyslog或者syslog是否开启 IpTable Iptable `xlsx:"防火墙策略"` //防火墙策略 Ufw Ufw `xlsx:"Ufw"` LogSizePolicy []string `xlsx:"保持日志长度"` //保持日志长度 TimeOutPolicy int `xlsx:"超时时间"` //超时时间 }
策略信息
type RunTimeInfo ¶
type RunTimeInfo struct { UpTime float64 `xlsx:"运行时间"` //运行时间 LoadAverage string `xlsx:"负载情况"` //负载情况 TaskTotal int `xlsx:"任务总数"` //任务总数 RunningTask int `xlsx:"运行任务总数"` //运行任务总数 SleepTask int `xlsx:"睡眠进程"` StoppedTask int `xlsx:"停止进程"` IdleTask int `xlsx:"闲置进程"` ZombieTask int `xlsx:"僵尸进程"` //僵尸进程 CPUUsePercent float64 `xlsx:"CPU占用"` //使用CPU信息 MEMFree uint64 `xlsx:"内存空闲"` SwapFree uint64 `xlsx:"SwapFree"` TaskList []Task `xlsx:"TaskList"` }
RunTimeInfo GetRunTimeInfo
type Service ¶
type Service struct { ServiceName string `xlsx:"服务名称"` IsServiceRunning bool `xlsx:"运行状态"` IsAutoRun bool `xlsx:"是否自启动"` }
服务器信息
type SystemFiles ¶
type SystemFiles struct { FileName string FileType string //文件类型:文件夹、可执行文件等 FileAttr string //文件属性 Permission string //文件操作权限,保存类型,777,755之类 FileUser string //文件使用者 FileGroup string //文件使用组 FileSize int //文件大小 CreateTime string }
系统文件
type SystemInfo ¶
type SystemInfo struct { Os string `json:"os"` //系统类型 PlatformVersion string `json:"操作信息版本"` //操作信息版本 RegionInfo string `json:"地区"` //地区 HostName string `json:"主机名"` //主机名 EnvironmentVariable map[string]string `json:"环境参数列表"` //环境参数列表 SystemFiles []SystemFiles `json:"系统文件例如host"` //系统文件例如host HardwareInfo HardwareInfo `json:"硬件信息"` //硬件信息 }
主机配置参数信息
type SystemProperties ¶
type SystemProperties struct { HostID string `json:"host_ID" gorm:"host_ID"` //主机编号 RiskValue string `json:"risk_value" gorm:"risk_value"` //风险值 Importance string `json:"importance" gorm:"importance"` //重要级 Business string `json:"business" gorm:"business"` //业务 Department string `json:"department" gorm:"department"` //部门 AdministratorUID int `json:"administrator_uid" gorm:"administrator_uid"` //运维管理员 }
主机属性
type Task ¶
type Task struct { PID int32 `xlsx:"PID"` Name string `xlsx:"进程名称"` User string `xlsx:"进程拥有者"` CPUPercent float64 `xlsx:"CPU占比"` //CPU占比 MEMPercent float32 `xlsx:"内存占比"` //内存占比 RunTime int `xlsx:"运行时长"` //运行时长 Command string `xlsx:"运行命令"` //运行命令 CreateTime time.Time `xlsx:"创建时间"` }
top运行任务
type WebLogInfo ¶
Click to show internal directories.
Click to hide internal directories.