monitor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUInfo

func CPUInfo() (int, float64)

func Hostname

func Hostname() string

func MemoryInfo

func MemoryInfo() (uint64, uint64, float64)

func NetworkBandwidthInfo

func NetworkBandwidthInfo() (uint64, uint64)

func UptimeInfo

func UptimeInfo() uint64

Types

type Device

type Device struct {
	Hostname          string  `json:"hostname"`
	System            System  `json:"system"`
	Uptime            uint64  `json:"uptime"`
	CPUCount          int     `json:"cpu_count"`
	CPUUsage          float64 `json:"cpu_usage"`
	MemoryTotal       uint64  `json:"memory_total"`
	MemoryUsed        uint64  `json:"memory_used"`
	MemoryUsedPercent float64 `json:"memory_used_percent"`
	Drives            []Drive `json:"drives"`
	NetworkUp         uint64  `json:"network_up"`
	NetworkDown       uint64  `json:"network_down"`
	NetworkCards      []Nic   `json:"network_cards"`
	Timestamp         string  `json:"timestamp"`
	UUID              string  `json:"uuid"`
}

func (*Device) ToJSON

func (d *Device) ToJSON() *bytes.Buffer

type Drive

type Drive struct {
	Name        string  `json:"name"`
	MountPoint  string  `json:"mount_point"`
	Type        string  `json:"type"`
	TotalSize   uint64  `json:"total_size"`
	UsedSize    uint64  `json:"used_size"`
	PercentUsed float64 `json:"percent_used"`
}

func DiskInfo

func DiskInfo() []Drive

type Nic

type Nic struct {
	Name     string `json:"name"`
	Mac      string `json:"mac"`
	Address  string `json:"address"`
	Address6 string `json:"address6"`
	Netmask  string `json:"netmask"`
}

func NetworkInterfaceInfo

func NetworkInterfaceInfo() []Nic

type System

type System struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

func OSInfo

func OSInfo() System

Jump to

Keyboard shortcuts

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