monitor

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreeCommandOutputAsArr

func GetFreeCommandOutputAsArr(row int) []string

GetFreeCommandOutputAsArr return `free` output

func GetLoadAvg added in v0.0.10

func GetLoadAvg() string

func GetMemory

func GetMemory() []string

func GetSwap

func GetSwap() []string

func IsServiceUp

func IsServiceUp(serviceName string) bool

IsServiceUp returns true if service is running

func MonitorAsJSON

func MonitorAsJSON(config config.Config) string

Types

type CustomMetric

type CustomMetric struct {
	Name     string
	Unit     string
	Value    string
	ServerId string
	Time     string
}

type Disk

type Disk struct {
	Time  string
	Disks [][]string
}

func GetDisks

func GetDisks(time string, config config.Config) Disk

Returns Disk struct with array of disks info `[ FileSystem, MountPoint, Type, Size, Free, Used, Used%, Inodes, IFree, IUsed, IUsed% ]`

type MonitorData

type MonitorData struct {
	UnixTime  string
	System    System
	Memory    []string
	Swap      []string
	Disk      Disk
	ProcUsage []string
	Networks  Network
	Processes Process
	Services  []Service
	ServerId  string
}

func Monitor

func Monitor(config config.Config) MonitorData

type Network

type Network struct {
	Time     string
	Networks [][]string
}

Network struct with network info `IP, Interface, Rx, Tx`

func GetNetwork

func GetNetwork(time string) Network

GetNetwork returns a Network struct

type Process

type Process struct {
	CPU    [][]string
	Memory [][]string
}

func GetProcesses added in v0.0.10

func GetProcesses() Process

GetProcesses returns struct with process info `PID, CPUUsage, MemoryUsage, Command`

type Processor

type Processor struct {
	Model     string
	NoOfCores string
	Freq      string
	Cache     string
	Temp      string
	LoadAvg   string
	Time      string
}

Processor struct with processor info

func GetProcessor

func GetProcessor() Processor

GetProcessor returns a Processor struct

type Service

type Service struct {
	Name    string
	Running bool
	Time    string
}

Service holds service activity info

func GetServices

func GetServices(unixTime string, config config.Config) []Service

type System

type System struct {
	HostName      string
	OS            string
	Kernel        string
	UpTime        string
	LastBootDate  string
	NoOfCurrUsers string
	DateTime      string
	Time          string
}

System struct with system info

func GetSystem

func GetSystem() System

GetSystem returns System struct

Jump to

Keyboard shortcuts

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