scan

package
v0.7.18-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MountHighUsedValue = 90

Variables

This section is empty.

Functions

func OS

OS 扫描系统信息

func SaveAsExcel

func SaveAsExcel(data []OSInfo) error

Types

type BaseOSInfo

type BaseOSInfo struct {
	Address  string // ip地址
	Hostname string // 主机名
	KernelV  string // 内核版本
	OSV      string // 操作系统版本
}

type CPUInfo

type CPUInfo struct {
	CPUThreadCount int    // cpu线程数
	CPUClockSpeed  string // cpu主频
	CPUModeNum     string // CPU版本号
	CPULoadAverage string // CPU版本号
}

func NewCPUInfoItem

func NewCPUInfoItem(content string) CPUInfo

type DiskInfo

type DiskInfo struct {
	RootMountUsedPercent      int    // 根路径使用率
	HighUsedPercentMountPoint string // 90%使用率挂载点
	OSDriveLetter             string // 系统分区
}

func NewDiskInfoItem

func NewDiskInfoItem(content string) DiskInfo

type DiskInfoMeta

type DiskInfoMeta struct {
	Filesystem   string
	Size         string
	Used         string
	Avail        string
	UsedPercent  string
	MountedPoint string
}

func NewDiskInfoMetaItem

func NewDiskInfoMetaItem(content string) (diskInfoMeta DiskInfoMeta)

数据结构 /dev/vda1 40G 3.4G 34G 9% /

type MemoryInfo

type MemoryInfo struct {
	MemUsed       float64 // 内存使用量
	MemUsePercent float64 // 内存使用占比
	MemTotal      float64 // 内存总量
}

func NewMemInfoItem

func NewMemInfoItem(content string) MemoryInfo

type OSInfo

type OSInfo struct {
	BaseOSInfo
	CPUInfo
	DiskInfo
	MemoryInfo
}

type OSInfoSlice

type OSInfoSlice []OSInfo

func (OSInfoSlice) Len

func (re OSInfoSlice) Len() int

func (OSInfoSlice) Less

func (re OSInfoSlice) Less(i, j int) bool

func (OSInfoSlice) Swap

func (re OSInfoSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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