model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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 Addr

type Addr struct {
	Ip   string `xlsx:"Ip"`
	Port int    `xlsx:"Port"`
}

type AppUser

type AppUser struct {
	Name          string `xlsx:"应用名称"`
	UID           string `xlsx:"linxu Uid"` //linxu Uid
	GID           string `xlsx:"linxu GID"`
	UserGroup     string `xlsx:"用户组"`                //用户组
	Permission    string `xlsx:"权限说明,运行bash命令,特权用户"` //权限说明,运行bash命令、特权用户
	EmptyPassword bool   `xlsx:"空口令"`                //空口令
}

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 Cpu

type Cpu struct {
	ModelName string  `xlsx:"芯片名"`
	CPUNum    int     `xlsx:"内核数"` //内核数
	CPUMHZ    float64 `xlsx:"主频"`  //主频
}

type CronTask

type CronTask struct {
	CronValue string `xlsx:"定时任务频率"`     //定时任务频率
	Shell     string `xlsx:"执行脚本或者脚本路径"` //执行脚本或者脚本路径
}

定时任务信息

type Disk

type Disk struct {
	FileSystem string  `xlsx:"盘符"`    //盘符
	Size       float64 `xlsx:"大小"`    //大小
	Used       float64 `xlsx:"使用大小"`  //使用大小
	Avail      float64 `xlsx:"剩余空间"`  //剩余空间
	UsePercent float64 `xlsx:"使用百分百"` //使用百分百
	Mount      string  `xlsx:"挂载路径"`  //挂载路径
}

type DiskStatus

type DiskStatus struct {
	All  uint64 `json:"all" xlsx:"All"`
	Used uint64 `json:"used" xlsx:"Used"`
	Free uint64 `json:"free" xlsx:"Free"`
}

type HDDevUsage

type HDDevUsage struct {
	DevName    string  `xlsx:"DevName"`
	FSName     string  `xlsx:"FSName"`
	UsedBlock  float64 `xlsx:"UsedBlock"`
	TotalBlock float64 `xlsx:"TotalBlock"`
	MountPoint string  `xlsx:"MountPoint"`
}

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 HostLog

type HostLog struct {
	HostLogList []string `xlsx:"主机日志列表"`
}

HostLog 主机Log

type Iptable

type Iptable struct {
	Status      bool     `xlsx:"防火墙开启状态"` //防火墙开启状态
	InPutRule   []string `xlsx:"入站策略"`    //入站策略
	ForwardRule []string `xlsx:"转发策略"`    //转发策略
	OutPutRule  []string `xlsx:"出战策略"`    //出战策略
	DenyList    []string `xlsx:"拒绝IP列表"`  //拒绝IP列表
}

type LogInfo

type LogInfo struct {
	HostLog    HostLog    `xlsx:"主机日志"`
	WebLog     WebLog     `xlsx:"网络日志"`
	HistoryLog HistoryLog `xlsx:"历史日志"` //历史命令日志
	LoginLog   []LoginLog `xlsx:"登录日志"` //登录信息
}

LogInfo /**

type LoginLog

type LoginLog struct {
	Username string `xlsx:"用户名"`
	Remote   string `xlsx:"登录形式"`
	Time     string `xlsx:"登录时间"`
	Status   string `xlsx:"登录状态"`
}

type Memory

type Memory struct {
	Total   uint64 `xlsx:"内存总量"`  //总量
	Used    uint64 `xlsx:"内存使用数"` //使用数
	Free    uint64 `xlsx:"内存空余"`  //空余
	Shared  uint64 `xlsx:"内存分享"`
	Buffers uint64 `xlsx:"内存Buffers"`
	Cached  uint64 `xlsx:"内存缓存"`
}

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 OtherLog

type OtherLog struct {
	LogType  string
	LogValue []string //存放关键的日志信息
}

OtherLog 其他日志

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 Swap

type Swap struct {
	Total uint64 `xlsx:"内存Total"`
	Used  uint64 `xlsx:"内存Used"`
	Free  uint64 `xlsx:"内存Free"`
}

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 Ufw

type Ufw struct {
	Status string   `xlsx:"状态"`
	Rules  []string `xlsx:"规则"`
}

type WebLog

type WebLog struct {
	WebLogInfoList []WebLogInfo `xlsx:"Web日志信息"`
}

WebLog web中间件信息

type WebLogInfo

type WebLogInfo struct {
	Name    string   `xlsx:"WEB服务名称"`
	LogPath []string `xlsx:"日志路径"` //日志所在路径
	LogList []string `xlsx:"日志列表"` //日志文件名
}

Jump to

Keyboard shortcuts

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